def add_ops(op_classes):
def f(cls):<EOL><INDENT>for op_attr_name, op_class in op_classes.items():<EOL><INDENT>ops = getattr(cls, '<STR_LIT>'.format(name=op_attr_name))<EOL>ops_map = getattr(cls, '<STR_LIT>'.format(<EOL>name=op_attr_name))<EOL>for op in ops:<EOL><INDENT>op_node = ops_map[op]<EOL>if op_node is not None:<EOL><INDENT>made_op = _op_maker(op_class, op)<EOL>setattr(cls, '<STR_LIT>'.format(node=op_node), made_op)<EOL><DEDENT><DEDENT><DEDENT>return cls<EOL><DEDENT>return f<EOL>
Decorator to add default implementation of ops.