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

Function submodule

Lib/test/test_importlib/util.py:127–131  ·  view source on GitHub ↗
(parent, name, pkg_dir, content='')

Source from the content-addressed store, hash-verified

125
126
127def submodule(parent, name, pkg_dir, content=''):
128 path = os.path.join(pkg_dir, name + '.py')
129 with open(path, 'w', encoding='utf-8') as subfile:
130 subfile.write(content)
131 return '{}.{}'.format(parent, name), path
132
133
134def get_code_from_pyc(pyc_path):

Callers

nothing calls this directly

Calls 4

openFunction · 0.50
joinMethod · 0.45
writeMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…