self.print_stats(stats)

def print_stats(self, stats):
    """
        This method processes the stats and prints them.
        """
stats.strip_dirs().sort_stats('cumulative').print_stats(20)

def __call__(self, func):
    self._func = func

@functools.wraps(func)
def wrapper(*args, **kwargs):
    with self:
        return func(*args, **kwargs)
return wrapper
How to find the statistics and execution times of the code in python