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

Function _get_format

Tools/c-analyzer/c_parser/datafiles.py:64–70  ·  view source on GitHub ↗
(file, default='tsv')

Source from the content-addressed store, hash-verified

62# formats
63
64def _get_format(file, default='tsv'):
65 if isinstance(file, str):
66 filename = file
67 else:
68 filename = getattr(file, 'name', '')
69 _, ext = os.path.splitext(filename)
70 return ext[1:] if ext else default
71
72
73def _get_format_handlers(group, fmt):

Callers 2

read_declsFunction · 0.85
write_declsFunction · 0.85

Calls 1

splitextMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…