code: def _set_dirty(self, obj=None):
          
          obj = obj or self
          for key, value in vars(obj).items():
              if key not in ('api', '_dirty_attributes', '_always_dirty', '_dirty_callback', '_dirty'):
                  setattr(obj, key, value)
                  if isinstance(value, BaseObject):
                      self._set_dirty(value)
docs: Recursively set self and all child objects _dirty flag.