def log_list_volumes(function):
 counter = itertools.count(1)
 def _count_calls(*args, **kwargs):
  '\n        Run given function with count.\n        '
  CALL_LIST_VOLUMES(function=function.__name__, count=next(counter)).write()
  return function(*args, **kwargs)
 return _count_calls

def log_list_volumes ( function ) : counter = itertools . count ( 1 ) def _count_calls ( * args , ** kwargs ) : CALL_LIST_VOLUMES ( function = function . __name__ , count = next ( counter ) ) . write ( ) return function ( * args , ** kwargs ) return _count_calls
decorator to count calls to list_volumes .