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

Function download_one

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

Source from the content-addressed store, hash-verified

18from flags import save_flag, get_flag, main # <1>
19
20def download_one(cc: str): # <2>
21 image = get_flag(cc)
22 save_flag(image, f'{cc}.gif')
23 print(cc, end=' ', flush=True)
24 return cc
25
26def download_many(cc_list: list[str]) -> int:
27 with futures.ThreadPoolExecutor() as executor: # <3>

Callers

nothing calls this directly

Calls 2

get_flagFunction · 0.90
save_flagFunction · 0.90

Tested by

no test coverage detected