MCPcopy Index your code
hub / github.com/numpy/numpy / write_code

Function write_code

numpy/_core/code_generators/generate_umath_doc.py:19–29  ·  view source on GitHub ↗
(target)

Source from the content-addressed store, hash-verified

17 return docstring
18
19def write_code(target):
20 with open(target, 'w') as fid:
21 fid.write(
22 "#ifndef NUMPY_CORE_INCLUDE__UMATH_DOC_GENERATED_H_\n"
23 "#define NUMPY_CORE_INCLUDE__UMATH_DOC_GENERATED_H_\n"
24 )
25 for place, string in docstrings.docdict.items():
26 cdef_name = f"DOC_{place.upper().replace('.', '_')}"
27 cdef_str = normalize_doc(string)
28 fid.write(f"#define {cdef_name} \"{cdef_str}\"\n")
29 fid.write("#endif //NUMPY_CORE_INCLUDE__UMATH_DOC_GENERATED_H\n")
30
31
32def main():

Callers 1

mainFunction · 0.85

Calls 6

openFunction · 0.85
normalize_docFunction · 0.85
itemsMethod · 0.80
replaceMethod · 0.80
upperMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…