MCPcopy Index your code
hub / github.com/DeepLabCut/DeepLabCut / path_to_module

Function path_to_module

tools/find_import_cycles.py:9–14  ·  view source on GitHub ↗
(root: Path, file: Path)

Source from the content-addressed store, hash-verified

7
8
9def path_to_module(root: Path, file: Path) -> str:
10 rel = file.relative_to(root)
11 parts = rel.with_suffix("").parts
12 if parts[-1] == "__init__":
13 parts = parts[:-1]
14 return ".".join((root.name, *parts)) if parts else root.name
15
16
17def module_to_file_map(root: Path) -> dict[str, Path]:

Callers 1

module_to_file_mapFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected