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

Function replace_code_includes_with_placeholders

scripts/doc_parsing_utils.py:97–106  ·  view source on GitHub ↗

Replace code includes with placeholders.

(text: list[str])

Source from the content-addressed store, hash-verified

95
96
97def replace_code_includes_with_placeholders(text: list[str]) -> list[str]:
98 """
99 Replace code includes with placeholders.
100 """
101
102 modified_text = text.copy()
103 includes = extract_code_includes(text)
104 for include in includes:
105 modified_text[include["line_no"] - 1] = CODE_INCLUDE_PLACEHOLDER
106 return modified_text
107
108
109def replace_placeholders_with_code_includes(

Callers 1

check_translationFunction · 0.85

Calls 1

extract_code_includesFunction · 0.85

Tested by

no test coverage detected