(f)
| 61 | orig_stack = inspect.stack() |
| 62 | |
| 63 | def decorator_wrapper(f): |
| 64 | if not inspect.isfunction(f): |
| 65 | raise TypeError(f"Expect a function, but got: {f}") |
| 66 | if utils.is_defined_in_class(orig_stack, f): |
| 67 | return f |
| 68 | return parse(f, utils.inspect_function_capture(f), check_well_formed=check_well_formed) |
| 69 | |
| 70 | if f is not None: |
| 71 | # if there are no optional args given, this will directly invoke the wrapper |