MCPcopy Create free account
hub / github.com/fastapi/fastapi / generate_en_path

Function generate_en_path

scripts/translate.py:51–58  ·  view source on GitHub ↗
(*, lang: str, path: Path)

Source from the content-addressed store, hash-verified

49
50
51def generate_en_path(*, lang: str, path: Path) -> Path:
52 en_docs_path = Path("docs/en/docs")
53 assert not str(path).startswith(str(en_docs_path)), (
54 f"Path must not be inside {en_docs_path}"
55 )
56 lang_docs_path = Path(f"docs/{lang}/docs")
57 out_path = Path(str(path).replace(str(lang_docs_path), str(en_docs_path)))
58 return out_path
59
60
61def get_prompt(

Callers 1

list_removableFunction · 0.85

Calls 1

PathClass · 0.50

Tested by

no test coverage detected