code: def _parse_path(path):
      """Parse a dataset's identifier or path into its parts
  
      Parameters
      ----------
      path : str or path-like object
          The path to be parsed.
  
      Returns
      -------
      ParsedPath or UnparsedPath
  
      Notes
      -----
      When legacy GDAL filenames are encountered, they will be returned
      in a UnparsedPath.
  
      """
      if isinstance(path, _Path):
          return path
  
      elif pathlib and isinstance(path, pathlib.PurePath):
          return _ParsedPath(path.as_posix(), None, None)
  
      elif isinstance(path, str):
          if sys.platform == "win32" and re.match(r"^[a-zA-Z]\:", path):
              if pathlib:
                  return _ParsedPath(
                      pathlib.Path(path).as_posix(), None, None
                  )
              else:
                  return _UnparsedPath(path)
  
          elif path.startswith("/vsi"):
              return _UnparsedPath(path)
  
          else:
              parts = urlparse(path)
  
      else:
          raise PathError("invalid path '{!r}'".format(path))
  
      # if the scheme is not one of Rasterio's supported schemes, we
      # return an UnparsedPath.
      if parts.scheme:
          if all(p in SCHEMES for p in parts.scheme.split("+")):
              return _ParsedPath.from_uri(path)
  
      return _UnparsedPath(path)
  
file_path: rasterio/rasterio/_path.py
imports: import pathlib
  import re
  import sys
  from urllib.parse import urlparse
  import attr
  from rasterio.errors import PathError
label_desc: Use image node_id 1 for calling a global function with example usage: _parse_path(path) and returns: _UnparsedPath, path, _ParsedPath, _ParsedPath, _ParsedPath, _UnparsedPath, _UnparsedPath