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

Function get_flag

20-executors/getflags/flags2_sequential.py:32–36  ·  view source on GitHub ↗
(base_url: str, cc: str)

Source from the content-addressed store, hash-verified

30MAX_CONCUR_REQ = 1
31
32def get_flag(base_url: str, cc: str) -> bytes:
33 url = f'{base_url}/{cc}/{cc}.gif'.lower()
34 resp = httpx.get(url, timeout=3.1, follow_redirects=True)
35 resp.raise_for_status() # <3>
36 return resp.content
37
38def download_one(cc: str, base_url: str, verbose: bool = False) -> DownloadStatus:
39 try:

Callers 1

download_oneFunction · 0.70

Calls 1

getMethod · 0.45

Tested by

no test coverage detected