-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
41 lines (31 loc) · 934 Bytes
/
main.py
File metadata and controls
41 lines (31 loc) · 934 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env python3
"""
A simple Python script that uses outdated dependencies.
This is for testing dependabot-core locally.
"""
import requests
import numpy as np
def fetch_data():
"""Fetch some sample data from a public API."""
response = requests.get("https://jsonplaceholder.typicode.com/posts/1")
return response.json()
def process_data(data):
"""Process the data with numpy."""
# Create a simple array
arr = np.array([1, 2, 3, 4, 5])
return {
"original_data": data,
"array_sum": np.sum(arr),
"array_mean": np.mean(arr)
}
def main():
"""Main function."""
print("Fetching data...")
data = fetch_data()
print(f"Fetched: {data['title']}")
print("Processing with numpy...")
result = process_data(data)
print(f"Array sum: {result['array_sum']}")
print(f"Array mean: {result['array_mean']}")
if __name__ == "__main__":
main()