class_docstr: Registry of pluggable filesystem implementations used in TFX components.
docstr: Get filesystem plugin for given path.
code: def get_filesystem_for_path(
      self, path: PathType
  ) -> Type[filesystem.Filesystem]:
      """Get filesystem plugin for given path."""
      # Assume local path by default, but extract filesystem prefix if available.
      if isinstance(path, str):
          path_bytes = path.encode("utf-8")
      elif isinstance(path, bytes):
          path_bytes = path
      else:
          raise ValueError("Invalid path type: %r." % path)
      result = re.match(b"^([a-z0-9]+://)", path_bytes)
      if result:
          scheme = result.group(1).decode("utf-8")
      else:
          scheme = ""
      return self.get_filesystem_for_scheme(scheme)
  
file_path: tfx/tfx/dsl/io/filesystem_registry.py
imports: import re
  import threading
  from typing import Type
  from tfx.dsl.io import filesystem
  from tfx.dsl.io.filesystem import PathType
label_desc: Use image node_id 4 for calling the FilesystemRegistry obj's underlying member method code with example usage: obj.get_filesystem_for_path(path) and returns: self