code: def remove_empty(fs, path):
      # type: (FS, Text) -> None
      
      path = abspath(normpath(path))
      try:
          while path not in ("", "/"):
              fs.removedir(path)
              path = dirname(path)
      except DirectoryNotEmpty:
          pass
docs: Remove all empty parents.
  
      Arguments:
          fs (FS): A filesystem instance.
          path (str): Path to a directory on the filesystem.