def generate_op_class(entity,
                      draw=draw_stalker_entity_menu_item,
                      idpostfix='',
                      label=None):
    """generates clunky opclass for given entity

    :param entity: The Stalker entity
    :param draw: The draw function, defaults to draw_stalker_entity_menu_item
    :param label: Label of this menu
    """
    idname = '%s%s' % (
        idname_template % (entity.entity_type, entity.id),
        idpostfix
    )
    return type(
        idname,
        (bpy.types.Menu, ),
        {
            'bl_idname': idname,
            'bl_label': label if label else entity.name,
            'stalker_entity_id': entity.id,
            'stalker_entity_type': entity.entity_type,
            'stalker_entity_name': entity.name,
            'draw': draw
        }
    )
dataset/ETHPy150Open eoyilmaz/anima/anima/env/blender/reviewer.py/generate_op_class/original