code: def parent(self):
          
          drv = self._drv
          root = self._root
          parts = self._parts
          if len(parts) == 1 and (drv or root):
              return self
          return self._from_parsed_parts(drv, root, parts[:-1])
docs: The logical parent of the path.