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

Function save_flag

20-executors/getflags/flags.py:32–33  ·  view source on GitHub ↗
(img: bytes, filename: str)

Source from the content-addressed store, hash-verified

30DEST_DIR = Path('downloaded') # <4>
31
32def save_flag(img: bytes, filename: str) -> None: # <5>
33 (DEST_DIR / filename).write_bytes(img)
34
35def get_flag(cc: str) -> bytes: # <6>
36 url = f'{BASE_URL}/{cc}/{cc}.gif'.lower()

Callers 3

download_oneFunction · 0.90
download_oneFunction · 0.90
download_manyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected