code: def get_engine(
      engine: Literal["auto", "pyarrow"] | type[Engine]
  ) -> type[Engine]:
      """Get the parquet engine backend implementation.
  
      Parameters
      ----------
      engine : {'auto', 'pyarrow', 'fastparquet'} or Engine subclass
          Parquet library to use. Defaults to 'auto', which uses ``pyarrow`` if
          it is installed, and falls back to the deprecated ``fastparquet`` otherwise.
  
      This can be used to inject third-party engine; e.g. from dask_cudf.
      """
      if isinstance(engine, type) and issubclass(engine, Engine):
          return engine
  
      if engine in ("arrow", "pyarrow-dataset"):
          warnings.warn(
              f"engine='{engine}' has been deprecated. "
              "Please use engine='pyarrow' instead.",
              category=FutureWarning,
          )
          engine = "pyarrow"
  
      if engine in ("auto", "pyarrow"):
          if "pyarrow" in _ENGINES:
              return _ENGINES["pyarrow"]
  
          try:
              import_required("pyarrow", "`pyarrow` not installed")
          except RuntimeError:
              if engine != "auto":
                  raise
          else:
              from dask.dataframe.io.parquet.arrow import (
                  ArrowDatasetEngine,
              )
  
              _ENGINES["pyarrow"] = eng = ArrowDatasetEngine
              return eng
  
      if engine in ("auto", "fastparquet"):
  
          def warn_fastparquet():
              if engine == "fastparquet":
                  warnings.warn(
                      "The fastparquet engine is deprecated and will be removed "
                      "in a future release. Please install pyarrow.",
                      category=FutureWarning,
                  )
              else:
                  warnings.warn(
                      "Could not find pyarrow; falling back to fastparquet, which "
                      "is deprecated and will be removed in a future release.",
                      category=FutureWarning,
                  )
  
          if "fastparquet" in _ENGINES:
              warn_fastparquet()
              return _ENGINES["fastparquet"]
  
          try:
              import_required(
                  "fastparquet", "`fastparquet` not installed"
              )
          except RuntimeError:
              if engine == "auto":
                  raise RuntimeError("`pyarrow` not installed")
              else:
                  raise
          else:
              from dask.dataframe.io.parquet.fastparquet import (
                  FastParquetEngine,
              )
  
              _ENGINES["fastparquet"] = fpq_eng = FastParquetEngine
              warn_fastparquet()
              return fpq_eng
  
      raise ValueError(
          f'Unsupported engine: "{engine}". Valid choices are "pyarrow" or "auto".'
      )
  
imports: from __future__ import annotations
  import contextlib
  import math
  import warnings
  from typing import Literal
  import pandas
  import tlz
  from fsspec.core import get_fs_token_paths
  from fsspec.utils import stringify_path
  import dask
  from dask.base import tokenize
  from dask.blockwise import BlockIndex
  from dask.dataframe.backends import dataframe_creation_dispatch
  from dask.dataframe.core import DataFrame, Scalar
  from dask.dataframe.io.io import from_map
  from dask.dataframe.io.parquet.utils import Engine, _sort_and_analyze_paths, _split_user_options
  from dask.dataframe.io.utils import DataFrameIOFunction, _is_local_fs
  from dask.dataframe.methods import concat
  from dask.delayed import Delayed
  from dask.highlevelgraph import HighLevelGraph
  from dask.layers import DataFrameIOLayer
  from dask.utils import apply, import_required, natural_sort_key, parse_bytes
label_desc: Use image node_id 6 for calling a global function with example usage: get_engine(engine) and returns: engine, _ENGINES, eng, _ENGINES, fpq_eng