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

Function _convert_str_to_file

numpy/testing/_private/extbuild.py:119–126  ·  view source on GitHub ↗

Helper function to create a file ``source.c`` in `dirname` that contains the string in `source`. Returns the file name

(source, dirname)

Source from the content-addressed store, hash-verified

117
118
119def _convert_str_to_file(source, dirname):
120 """Helper function to create a file ``source.c`` in `dirname` that contains
121 the string in `source`. Returns the file name
122 """
123 filename = dirname / 'source.c'
124 with filename.open('w') as f:
125 f.write(str(source))
126 return filename
127
128
129def _make_methods(functions, modname):

Callers 1

compile_extension_moduleFunction · 0.85

Calls 2

openMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…