code: def has_parent(self, router):
          '''Check if ``router`` is ``self`` or a parent or ``self``
          '''
          parent = self
          while parent and parent is not router:
              parent = parent._parent
          return parent is not Nonf has_parent(self, router):
          '''Check if ``router`` is ``self`` or a parent or ``self``
          '''
          parent = self
          while parent and parent is not router:
              parent = parent._parent
          return parent is not None
docs: Check if ``router`` is ``self`` or a parent or ``self``