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

Function listrepl

numpy/f2py/_src_pyf.py:135–146  ·  view source on GitHub ↗
(mobj)

Source from the content-addressed store, hash-verified

133 substr = named_re.sub(r"<\1>", substr) # get rid of definition templates
134
135 def listrepl(mobj):
136 thelist = conv(mobj.group(1).replace(r'\,', '@comma@'))
137 if template_name_re.match(thelist):
138 return f"<{thelist}>"
139 name = None
140 for key in lnames.keys(): # see if list is already in dictionary
141 if lnames[key] == thelist:
142 name = key
143 if name is None: # this list is not in the dictionary yet
144 name = unique_key(lnames)
145 lnames[name] = thelist
146 return f"<{name}>"
147
148 # convert all lists to named templates
149 # new names are constructed as needed

Callers

nothing calls this directly

Calls 4

replaceMethod · 0.80
convFunction · 0.70
unique_keyFunction · 0.70
keysMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…