def with_attributes(*use_attributes):
 vmap = {False: 0, True: 1}
 values = [vmap[bool(v)] for v in use_attributes]
 def set_value(function):
  try:
   function.ATTRIBUTES.update(values)
  except AttributeError:
   function.ATTRIBUTES = set(values)
  return function
 return set_value

def with_attributes ( * use_attributes ) : vmap = { False : 0 , True : 1 } values = [ vmap [ bool ( v ) ] for v in use_attributes ] def set_value ( function ) : try : function . ATTRIBUTES . update ( values ) except AttributeError : function . ATTRIBUTES = set ( values ) return function return set_value
decorator for benchmarks that use attributes .