MCPcopy Create free account
hub / github.com/numpy/numpy / process_str

Function process_str

numpy/distutils/from_template.py:190–207  ·  view source on GitHub ↗
(allstr)

Source from the content-addressed store, hash-verified

188 return newstr
189
190def process_str(allstr):
191 newstr = allstr
192 writestr = ''
193
194 struct = parse_structure(newstr)
195
196 oldend = 0
197 names = {}
198 names.update(_special_names)
199 for sub in struct:
200 cleanedstr, defs = find_and_remove_repl_patterns(newstr[oldend:sub[0]])
201 writestr += cleanedstr
202 names.update(defs)
203 writestr += expand_sub(newstr[sub[0]:sub[1]], names)
204 oldend = sub[1]
205 writestr += newstr[oldend:]
206
207 return writestr
208
209include_src_re = re.compile(r"(\n|\A)\s*include\s*['\"](?P<name>[\w\d./\\]+\.src)[&#x27;\"]", re.I)
210

Callers 3

test_from_templateFunction · 0.90
process_fileFunction · 0.70
mainFunction · 0.70

Calls 4

updateMethod · 0.80
parse_structureFunction · 0.70
expand_subFunction · 0.70

Tested by 1

test_from_templateFunction · 0.72