def METHOD_NAME(self, data):
    from zou.app.models.preview_file import PreviewFile
    from zou.app.models.entity_type import EntityType
    entity_ids = []
    model_type = data.get("type", "Shot")
    if "entities_out" in data:
        entity_ids = data["entities_out"]
        del data["entities_out"]
    if "asset_type_id" in data:
        data["entity_type_id"] = data["asset_type_id"]
        del data["asset_type_id"]
        del data["asset_type_name"]
    if "sequence_id" in data:
        data["parent_id"] = data["sequence_id"]
        del data["sequence_id"]
    if (
        "preview_file_id" in data
        and data["preview_file_id"] is not None
        and len(data["preview_file_id"]) > 0
    ):
        preview_file = PreviewFile.get(data["preview_file_id"])
        if preview_file is None:
            del data["preview_file_id"]
    elif "preview_file_id" in data:
        del data["preview_file_id"]
    if "frame_in" in data:
        data["data"]["frame_in"] = data["frame_in"]
        del data["frame_in"]
    if "frame_out" in data:
        data["data"]["frame_out"] = data["frame_out"]
        del data["frame_out"]
    if "fps" in data:
        data["data"]["fps"] = data["fps"]
        del data["fps"]
    for field in [
        "entities_in",
        "episode_id",
        "episode_name",
        "project_name",
        "sequence_name",
        "tasks",
        "type",
    ]:
        if field in data:
            del data[field]
    if model_type in ["Shot", "Sequence", "Episode", "Edit"]:
        entity_type = EntityType.get_by(name=model_type)
        data["entity_type_id"] = entity_type.id
    return (data, entity_ids)