chore: import upstream snapshot with attribution
Validate YAML Workflows / Validate YAML Configuration Files (push) Has been cancelled

This commit is contained in:
wehub-resource-sync
2026-07-13 12:37:51 +08:00
commit d0e4308def
614 changed files with 74458 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
def get_city_num(city: str) -> dict:
"""
Fetch the city code for a given city name.
Example response:
{
"city": "Beijing",
"city_num": "1010",
}
"""
return {
"city_num": 3701
}
def get_weather(city_num: int, unit: str = "celsius") -> dict:
"""
Fetch weather information for the city represented by ``city_num``.
Example response:
{
"city_num": "1010",
"temperature": 20,
"unit": "celsius"
}
"""
temperature_c = 15 # Hardcode the temperature value
if unit == "fahrenheit":
temperature = temperature_c * 9 / 5 + 32
else:
temperature = temperature_c
return {
"city_num": city_num,
"temperature": temperature,
"unit": unit
}