MCPcopy
hub / github.com/fluentpython/example-code-2e / download_many

Function download_many

20-executors/getflags/flags.py:42–47  ·  view source on GitHub ↗
(cc_list: list[str])

Source from the content-addressed store, hash-verified

40 return resp.content
41
42def download_many(cc_list: list[str]) -> int: # <10>
43 for cc in sorted(cc_list): # <11>
44 image = get_flag(cc)
45 save_flag(image, f'{cc}.gif')
46 print(cc, end=' ', flush=True) # <12>
47 return len(cc_list)
48
49def main(downloader: Callable[[list[str]], int]) -> None: # <13>
50 DEST_DIR.mkdir(exist_ok=True) # <14>

Callers 1

mainFunction · 0.70

Calls 2

get_flagFunction · 0.70
save_flagFunction · 0.70

Tested by

no test coverage detected