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

Function opened

Tools/c-analyzer/c_parser/source.py:58–64  ·  view source on GitHub ↗
(source, filename=None)

Source from the content-addressed store, hash-verified

56
57@contextlib.contextmanager
58def opened(source, filename=None):
59 source, filename = resolve(source, filename)
60 if isinstance(source, str):
61 with open(source) as srcfile:
62 yield srcfile, filename
63 else:
64 yield source, filename

Callers

nothing calls this directly

Calls 2

resolveFunction · 0.70
openFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…