def update(self, id, data):
        id = self._validate_id_format(id)
        new_data = self._sanitize_for_update(data)

        if id in self.del_obj:
            raise exceptions.IdNotFound(message='%s id %d does not exist' %
                                        (self.model, id))

        obj = None

        try:
            obj = self.base.get(id)
        except exceptions.IdNotFound:
            if id in self.new_obj:
                obj = self.new_obj[id]

        if not obj:
            raise exceptions.IdNotFound(message='%s id %d does not exist' %
                                        (self.model, id))

        existing_obj = self._update_object(obj)

        if not id in self.upd_obj:
            self.upd_obj[id] = {}

        for field in new_data:
            if existing_obj[field] != new_data[field]:
                self.upd_obj[id][field] = new_data[field]

        new_obj = self._update_object(existing_obj)
        return new_obj
dataset/ETHPy150Open rcbops/opencenter/opencenter/db/abstraction.py/EphemeralAbstraction.update/original