def METHOD_NAME(self, data):
    entity = None
    try:
        entity = assets_service.get_raw_asset_by_shotgun_id(
            data["shotgun_id"]
        )
        entity.update(data)
        assets_service.clear_asset_cache(str(entity.id))
        current_app.logger.info("Entity updated: %s" % entity)
    except AssetNotFoundException:
        if data.get("entity_type_id", None) is not None:
            entity = Entity(**data)
            entity.save()
            current_app.logger.info("Entity created: %s" % entity)
        else:
            current_app.logger.info("Entity ignored: %s" % data["name"])
    return entity