MCPcopy Index your code
hub / github.com/python/mypy / clone

Function clone

misc/perf_compare.py:62–72  ·  view source on GitHub ↗
(target_dir: str, commit: str | None, repo_source: str | None = None)

Source from the content-addressed store, hash-verified

60
61
62def clone(target_dir: str, commit: str | None, repo_source: str | None = None) -> None:
63 source_name = repo_source or "mypy"
64 heading(f"Cloning {source_name} to {target_dir}")
65 if repo_source is None:
66 repo_source = os.getcwd()
67 if os.path.isdir(target_dir):
68 print(f"{target_dir} exists: deleting")
69 shutil.rmtree(target_dir)
70 subprocess.run(["git", "clone", repo_source, target_dir], check=True)
71 if commit:
72 subprocess.run(["git", "checkout", commit], check=True, cwd=target_dir)
73
74
75def edit_python_file(fnam: str) -> None:

Callers 3

mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.85

Calls 4

printFunction · 0.85
headingFunction · 0.70
isdirMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…