code: def memory_usage(method):
    
    def wrapper(*args, **kwargs):
      logging.info('Memory before method %s is %s.',
                   method.__name__, runtime.memory_usage().current())
      result = method(*args, **kwargs)
      logging.info('Memory after method %s is %s',
                   method.__name__, runtime.memory_usage().current())
      return result
    return wrapper
docs: Log memory usage before and after a method.