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

Method from_raw

Tools/c-analyzer/c_parser/info.py:163–173  ·  view source on GitHub ↗
(cls, raw)

Source from the content-addressed store, hash-verified

161class FileInfo(namedtuple('FileInfo', 'filename lno')):
162 @classmethod
163 def from_raw(cls, raw):
164 if isinstance(raw, cls):
165 return raw
166 elif isinstance(raw, tuple):
167 return cls(*raw)
168 elif not raw:
169 return None
170 elif isinstance(raw, str):
171 return cls(raw, -1)
172 else:
173 raise TypeError(f'unsupported "raw": {raw:!r}')
174
175 def __str__(self):
176 return self.filename

Callers 4

from_rowMethod · 0.45
_resolve_fileMethod · 0.45
_from_rowMethod · 0.45
parseFunction · 0.45

Calls 1

clsClass · 0.50

Tested by

no test coverage detected