A collection of updated useful & common decorators
List of decorators:
@chdir_back_and_forth: Temporarily change dir topathin the function, then return back to the original cwd.@timing()or@Timing(): Print out the running time of the function, support repeated run.@deprecated(): Raise exception or print out the deprecated warning for the function.@pass_except(): Ignore exceptions raised in the function.@repeat(): Repeat a functionntimes.@slow_down(): Pause/sleep/delay in specified seconds after the function is finished.@retry(): Allow function to haventime errors.@limit_run(): Raise RuntimeError if a function run exceedsntimes.@timeout(): Raise RuntimeError if a function run exceeds an time interval.@override_args(): Override default keyword arguments of the function.@force_input_arg(): Raise TypeError ifkwargs_to_forceis not passed in to function as kwargs.@accepts(): Checks decorated function's arguments are of the expected types.@returns(): Checks decorated function's return value is of the expected type.@wip_warning(): Print or raise WorkInProcessWarning exception if the function is called.