Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions test-project/main.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
"""
Simple Python application for testing autonomous agent
"""
import json
from datetime import datetime

def calculate_age(birth_year):
"""Calculate age from birth year"""
current_year = datetime.now().year
return current_year - birth_year

def greet(name):
return f"Hello, {name}!"

def format_greeting(name, birth_year):
"""Format a greeting with age"""
age = calculate_age(birth_year)
# BUG: Missing import for json module
greeting = greet(name)

# Format as JSON
data = json.dumps({
"name": name,
"greeting": greeting,
"age": age,
"timestamp": datetime.now().isoformat()
"name": name
})
return data

if __name__ == "__main__":
print("Testing the application...")
result = format_greeting("Test User", 1990)
print(result)