def _template_init(cls):
        template_cls = get_dbo_class(cls.template_id)
        old_class = getattr(template_cls, 'instance_cls', None)
        if old_class:
            existing_fields = old_class.dbot_fields.values()
            log.info("Overriding existing instance class {} with {} for template {}", old_class.__name__, cls.__name__,
                     cls.template_id)
        else:
            log.info("Initializing instance class {} for template {}", cls.__name__, cls.template_id)
            existing_fields = ()
        new_dbo_fields = {name: DBOField(*dbo_field.args, **dbo_field.kwargs) for name, dbo_field in
                          cls.dbot_fields.items() if dbo_field not in existing_fields}
        template_cls.add_dbo_fields(new_dbo_fields)
        template_cls.instance_cls = cls
        cls.template_cls = template_cls
dataset/ETHPy150Open genzgd/Lampost-Mud/lampost/core/meta.py/CommonMeta._template_init/original