<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def DirnamePath(self, path):
 """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. """

    if path.endswith(self.PATH_SEPARATOR):
      path = path[:-1]
    if not path:
      return None

    dirname, _, _ = path.rpartition(self.PATH_SEPARATOR)
    return dirname