MCPcopy
hub / github.com/commaai/openpilot / eval_source

Function eval_source

tools/lib/file_sources.py:43–57  ·  view source on GitHub ↗
(files: dict[int, list[str] | str])

Source from the content-addressed store, hash-verified

41
42
43def eval_source(files: dict[int, list[str] | str]) -> dict[int, str]:
44 # Returns valid file URLs given a list of possible file URLs for each segment (e.g. rlog.bz2, rlog.zst)
45 valid_files: dict[int, str] = {}
46
47 for seg_idx, urls in files.items():
48 if isinstance(urls, str):
49 urls = [urls]
50
51 # Add first valid file URL
52 for url in urls:
53 if file_exists(url):
54 valid_files[seg_idx] = url
55 break
56
57 return valid_files

Callers 3

internal_sourceFunction · 0.85
openpilotci_sourceFunction · 0.85

Calls 2

file_existsFunction · 0.90
itemsMethod · 0.80

Tested by

no test coverage detected