MCPcopy Create free account
hub / github.com/apple/coremltools / write_automodule

Function write_automodule

deps/protobuf/python/docs/generate_docs.py:160–168  ·  view source on GitHub ↗
(module)

Source from the content-addressed store, hash-verified

158
159
160def write_automodule(module):
161 contents = AUTOMODULE_TEMPLATE.format(module=module, underline="=" * len(module),)
162 automodule_path = DOCS_DIR.joinpath(*module.split(".")).with_suffix(".rst")
163 try:
164 automodule_path.parent.mkdir(parents=True)
165 except FileExistsError:
166 pass
167 with open(automodule_path, "w") as automodule_file:
168 automodule_file.write(contents)
169
170
171def replace_toc(modules):

Callers 1

mainFunction · 0.85

Calls 4

openFunction · 0.85
lenFunction · 0.50
formatMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected