MCPcopy Index your code
hub / github.com/fluentpython/example-code-2e / download_one

Function download_one

20-executors/getflags/flags_asyncio.py:20–24  ·  view source on GitHub ↗
(client: AsyncClient, cc: str)

Source from the content-addressed store, hash-verified

18from flags import BASE_URL, save_flag, main # <2>
19
20async def download_one(client: AsyncClient, cc: str): # <3>
21 image = await get_flag(client, cc)
22 save_flag(image, f'{cc}.gif')
23 print(cc, end=' ', flush=True)
24 return cc
25
26async def get_flag(client: AsyncClient, cc: str) -> bytes: # <4>
27 url = f'{BASE_URL}/{cc}/{cc}.gif'.lower()

Callers 1

supervisorFunction · 0.70

Calls 2

save_flagFunction · 0.90
get_flagFunction · 0.70

Tested by

no test coverage detected