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

Function process_and_write_file

numpy/_build_utils/process_src_template.py:22–33  ·  view source on GitHub ↗

Process tempita templated file and write out the result. The template file is expected to end in `.src` (e.g., `.c.src` or `.h.src`). Processing `npy_somefile.c.src` generates `npy_somefile.c`.

(fromfile, outfile)

Source from the content-addressed store, hash-verified

20
21
22def process_and_write_file(fromfile, outfile):
23 """Process tempita templated file and write out the result.
24
25 The template file is expected to end in `.src`
26 (e.g., `.c.src` or `.h.src`).
27 Processing `npy_somefile.c.src` generates `npy_somefile.c`.
28
29 """
30 process_file = get_processor()
31 content = process_file(fromfile)
32 with open(outfile, 'w') as f:
33 f.write(content)
34
35
36def main():

Callers 1

mainFunction · 0.85

Calls 4

openFunction · 0.85
get_processorFunction · 0.70
process_fileFunction · 0.70
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…