decorators

A module containing different decorators which could be useful.

Summary

Functions:

count_decorator

Decorator which counts the number of times a function is called.

get_arg_var_by_name

Returns the value of the argument with the given name.

Reference

count_decorator(
func,
*args,
**kwargs,
) Any[source]

Decorator which counts the number of times a function is called.

Parameters:
  • func (Callable) – The function to be decorated.

  • args – The arguments of the function.

  • kwargs – The keyword arguments of the function.

get_arg_var_by_name(func, args, arg_name)[source]

Returns the value of the argument with the given name.