(fn)
return wrapper
Decorator to track the number of times a function is called.

    :param fn: the function to be decorated
    :type fn: C{func}

    :return: the decorated function
    :rtype: C{func}
Decorator to track the number of times a function is called.
Decorator to track the number of times a function is called .
def count_calls(fn):
    """
    Decorator to track the number of times a function is called.

    :param fn: the function to be decorated
    :type fn: C{func}

    :return: the decorated function
    :rtype: C{func}
    """

    @functools.wraps(fn)
    def wrapper(*args, **kwargs):
        counter("%s_calls" % get_qualname(fn)).inc()
        return fn(*args, **kwargs)

    return wrapper
def count_calls ( fn ) : @ functools . wraps ( fn ) def wrapper ( * args , * * kwargs ) : counter ( "%s_calls" % get_qualname ( fn ) ) . inc ( ) return fn ( * args , * * kwargs ) return wrapper