def gen_code(pathname, context):
    env = Environment(loader=PackageLoader('json_to_model.generators',
                                           'templates'))
    header_template = env.get_template('header.h')
    source_template = env.get_template('source.m')
    for class_name, clazz in context.classes.iteritems():
        original_name = class_name
        class_name = english.classify(original_name)
        properties = []
        includes = set()
        for node in clazz.children:
            if property_is_inherited(context, clazz, node):
                continue
            properties.append({
                'type': get_property_type(context, node),
                'name': get_property_name(context, node),
                'original_name': node.name,
                'retain_type': retain_map[node.type],
                'children_type': get_type_of_first_obj_in_array(context, node)
            })
            if node.class_name:
                includes.add(get_property_type(context, node))
            if node.children:
                if node.children[0].class_name:
                    includes.add(get_property_type(context, node.children[0]))

        super_name = english.classify(clazz.super_class.class_name)\
            if clazz.super_class else 'NSObject'
        if super_name != 'NSObject':
            includes.add(super_name)

        with open(os.path.join(pathname, '%s.h' % class_name), 'wb') as f:
            f.write(header_template.render(time=time.ctime(),
                                           class_name=class_name,
                                           super_name=super_name,
                                           properties=properties,
                                           includes=includes))
        with open(os.path.join(pathname, class_name % '%s.m'), 'wb') as f:
            f.write(source_template.render(time=time.ctime(),
                                           class_name=class_name,
                                           super_name=super_name,
                                           properties=properties))
dataset/ETHPy150Open clowwindy/json_to_model/json_to_model/generators/objc.py/gen_code/swapped operands of `%`