code: def _clean_dirty(self, obj=None):
          
          obj = obj or self
          obj.__dict__['_dirty_attributes'].clear()
          obj._dirty = False
          for key, val in vars(obj).items():
              if isinstance(val, BaseObject):
                  self._clean_dirty(val)
              else:
                  func = getattr(val, '_clean_dirty', None)
                  if callable(func):
                      func()
docs: Recursively clean self and all child objects.