code: def GetParent(self):
      
      if self.root:
        return None
  
      return PathInfo(
          components=self.components[:-1],
          path_type=self.path_type,
          directory=True)
docs: Constructs a path info corresponding to the parent of current path.
  
      The root path (represented by an empty list of components, corresponds to
      `/` on Unix-like systems) does not have a parent.
  
      Returns:
        Instance of `rdf_objects.PathInfo` or `None` if parent does not exist.