MCPcopy
hub / github.com/mne-tools/mne-python / _get_argvalues

Function _get_argvalues

mne/utils/misc.py:295–315  ·  view source on GitHub ↗

Return all arguments (except self) and values of read_raw_xxx.

()

Source from the content-addressed store, hash-verified

293
294
295def _get_argvalues():
296 """Return all arguments (except self) and values of read_raw_xxx."""
297 # call stack
298 # read_raw_xxx -> <decorator-gen-000> -> BaseRaw.__init__ -> _get_argvalues
299
300 # This is equivalent to `frame = inspect.stack(0)[4][0]` but faster
301 frame = inspect.currentframe()
302 try:
303 for _ in range(3):
304 frame = frame.f_back
305 fname = frame.f_code.co_filename
306 if not fnmatch.fnmatch(fname, "*/mne/io/*"):
307 return None
308 args, _, _, values = inspect.getargvalues(frame)
309 finally:
310 del frame
311 params = dict()
312 for arg in args:
313 params[arg] = values[arg]
314 params.pop("self", None)
315 return params
316
317
318def sizeof_fmt(num):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected