code: def DirnamePath(self, path):
      
      if path.endswith(self.PATH_SEPARATOR):
        path = path[:-1]
      if not path:
        return None
  
      dirname, _, _ = path.rpartition(self.PATH_SEPARATOR)
      return dirname
docs: Determines the directory name of the path.
  
      The file system root is represented by an empty string.
  
      Args:
        path (str): path.
  
      Returns:
        str: directory name of the path or None.