code: def eq_or_parent(self, other):
          
          return self.parts[: len(other.parts)] == other.parts[: len(self.parts)]
docs: Check whether ``other`` is an ancestor.
  
          Returns:
              (bool) True IFF ``other`` is an ancestor or equal to ``self``,
              else False.