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

Method _is_python

Lib/profiling/sampling/gecko_collector.py:386–387  ·  view source on GitHub ↗
(self, filename: str)

Source from the content-addressed store, hash-verified

384 return thread
385
386 def _is_python(self, filename: str) -> bool:
387 return not filename.startswith("<") or filename in ["<stdin>", "<string>"]
388
389 def _get_category(self, filename: str) -> int:
390 return CATEGORY_PYTHON if self._is_python(filename) else CATEGORY_NATIVE

Callers 2

_get_categoryMethod · 0.95
_get_or_create_funcMethod · 0.95

Calls 1

startswithMethod · 0.45

Tested by

no test coverage detected