def add_ops(op_classes):
 def f(cls):
  for (op_attr_name, op_class) in compat.iteritems(op_classes):
   ops = getattr(cls, '{0}_ops'.format(op_attr_name))
   ops_map = getattr(cls, '{0}_op_nodes_map'.format(op_attr_name))
   for op in ops:
    op_node = ops_map[op]
    if (op_node is not None):
     made_op = _op_maker(op_class, op)
     setattr(cls, 'visit_{0}'.format(op_node), made_op)
  return cls
 return f

def add_ops ( op_classes ) : def f ( cls ) : for ( op_attr_name , op_class ) in compat . iteritems ( op_classes ) : ops = getattr ( cls , '{0}_ops' . format ( op_attr_name ) ) ops_map = getattr ( cls , '{0}_op_nodes_map' . format ( op_attr_name ) ) for op in ops : op_node = ops_map [ op ] if ( op_node is not None ) : made_op = _op_maker ( op_class , op ) setattr ( cls , 'visit_{0}' . format ( op_node ) , made_op ) return cls return f
decorator to add default implementation of ops .