MCPcopy Index your code
hub / github.com/python/cpython / get_defines

Function get_defines

Tools/scripts/summarize_stats.py:55–66  ·  view source on GitHub ↗
(filepath: Path, prefix: str = "SPEC_FAIL")

Source from the content-addressed store, hash-verified

53
54def _load_metadata_from_source():
55 def get_defines(filepath: Path, prefix: str = "SPEC_FAIL"):
56 with open(SOURCE_DIR / filepath) as spec_src:
57 defines = collections.defaultdict(list)
58 start = "#define " + prefix + "_"
59 for line in spec_src:
60 line = line.strip()
61 if not line.startswith(start):
62 continue
63 line = line[len(start) :]
64 name, val = line.split()
65 defines[int(val.strip())].append(name.strip())
66 return defines
67
68 import opcode
69

Callers 1

Calls 5

openFunction · 0.50
stripMethod · 0.45
startswithMethod · 0.45
splitMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…