Return all arguments (except self) and values of read_raw_xxx.
()
| 293 | |
| 294 | |
| 295 | def _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 | |
| 318 | def sizeof_fmt(num): |