<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _set_dirty(self, obj=None):
 """ Recursively set self and all child objects _dirty flag. """

        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)