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

Function split_arguments

numpy/_core/code_generators/genapi.py:192–221  ·  view source on GitHub ↗
(argstr)

Source from the content-addressed store, hash-verified

190 raise ValueError(f"no match '{lbrac}' for '{rbrac}' ({s!r})")
191
192def split_arguments(argstr):
193 arguments = []
194 current_argument = []
195 i = 0
196
197 def finish_arg():
198 if current_argument:
199 argstr = ''.join(current_argument).strip()
200 m = re.match(r'(.*(\s+|\*))(\w+)$', argstr)
201 if m:
202 typename = m.group(1).strip()
203 name = m.group(3)
204 else:
205 typename = argstr
206 name = ''
207 arguments.append((typename, name))
208 del current_argument[:]
209 while i < len(argstr):
210 c = argstr[i]
211 if c == ',':
212 finish_arg()
213 elif c == '(':
214 p = skip_brackets(argstr[i:], '(', ')')
215 current_argument += argstr[i:i + p]
216 i += p - 1
217 else:
218 current_argument += c
219 i += 1
220 finish_arg()
221 return arguments
222
223
224def find_functions(filename, tag='API'):

Callers 1

find_functionsFunction · 0.85

Calls 2

finish_argFunction · 0.85
skip_bracketsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…