def reducer(*tokens):
 def decorator(func):
  if (not hasattr(func, 'reducers')):
   func.reducers = []
  func.reducers.append(list(tokens))
  return func
 return decorator

def reducer ( * tokens ) : def decorator ( func ) : if ( not hasattr ( func , 'reducers' ) ) : func . reducers = [ ] func . reducers . append ( list ( tokens ) ) return func return decorator
decorator for reduction methods .