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

Function is_installed

Tools/c-analyzer/c_common/scriptutil.py:62–71  ·  view source on GitHub ↗
(filename, *, allowsuffix=True)

Source from the content-addressed store, hash-verified

60
61
62def is_installed(filename, *, allowsuffix=True):
63 if not allowsuffix and filename.endswith('.py'):
64 return False
65 filename = os.path.abspath(os.path.normalize(filename))
66 found = shutil.which(os.path.basename(filename))
67 if not found:
68 return False
69 if found != filename:
70 return False
71 return _is_standalone(filename)
72
73
74def is_standalone(filename):

Callers

nothing calls this directly

Calls 5

_is_standaloneFunction · 0.85
endswithMethod · 0.45
abspathMethod · 0.45
normalizeMethod · 0.45
basenameMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…