<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def has_parent_object(self, dir_object):
 """Return `True` if dir_object is a direct or indirect parent directory, or if both are the same object."""

        obj = self
        while obj:
            if obj == dir_object:
                return True
            obj = obj.parent_dir
        return False