<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def save_partial(self, data=None, allow_protected_fields=False, **kwargs):
 """ Saves just the currently set fields in the database. """


        # Backwards compat, deprecated argument
        if "dotnotation" in kwargs:
            del kwargs["dotnotation"]

        if data is None:

            data = dotdict(self)
            if "_id" not in data:
                raise KeyError("_id must be set in order to do a save_partial()")
            del data["_id"]

        if len(data) == 0:
          return

        if not allow_protected_fields:
            self.mongokat_collection._check_protected_fields(data)

        apply_on = dotdict(self)

        self._initialized_with_doc = False

        self.mongokat_collection.update_one({"_id": self["_id"]}, {"$set": data}, **kwargs)

        for k, v in data.items():
            apply_on[k] = v

        self.update(dict(apply_on))