code: def normpath(self, path):
          
          path = self.normcase(path)
          drive, path = self.splitdrive(path)
          sep = self._path_separator(path)
          is_absolute_path = path.startswith(sep)
          path_components = path.split(sep)
          collapsed_path_components = []
          dot = self._matching_string(path, '.')
          dotdot = self._matching_string(path, '..')
          for component in path_components:
              if (not component) or (component == dot):
                  continue
              if component == dotdot:
                  if collapsed_path_components and (
                          collapsed_path_components[-1] != dotdot):
                      # Remove an up-reference: directory/..
                      collapsed_path_components.pop()
                      continue
                  elif is_absolute_path:
                      # Ignore leading .. components if starting from the
                      # root directory.
                      continue
              collapsed_path_components.append(component)
          collapsed_path = sep.join(collapsed_path_components)
          if is_absolute_path:
              collapsed_path = sep + collapsed_path
          return drive + collapsed_path or dot
docs: Mimic os.path.normpath using the specified path_separator.
  
          Mimics os.path.normpath using the path_separator that was specified
          for this FakeFilesystem. Normalizes the path, but unlike the method
          absnormpath, does not make it absolute.  Eliminates dot components
          (. and ..) and combines repeated path separators (//).  Initial ..
          components are left in place for relative paths.
          If the result is an empty path, '.' is returned instead.
  
          This also replaces alternative path separator with path separator.
          That is, it behaves like the real os.path.normpath on Windows if
          initialized with '\\' as path separator and  '/' as alternative
          separator.
  
          Args:
              path:  (str) The path to normalize.
  
          Returns:
              (str) A copy of path with empty components and dot components
              removed.