code: def get_compression_settings(key: str) -> str | None:
      """Fetch and validate compression settings, with a nice error message in case of
      failure. This also resolves 'auto', which may differ between different hosts of the
      same cluster.
      """
      name = dask.config.get(key)
      try:
          return compressions[name].name
      except KeyError:
          valid = ",".join(repr(n) for n in compressions)
          raise ValueError(
              f"Invalid compression setting {key}={name}. Valid options are {valid}."
          )
  
file_path: distributed/distributed/protocol/compression.py
imports: from __future__ import annotations
  import zlib
  from collections.abc import Callable, Iterable
  from contextlib import suppress
  from functools import partial
  from random import randint
  from typing import TYPE_CHECKING, Any, Literal, NamedTuple
  from packaging.version import parse
  from tlz import identity
  import dask
  from distributed.metrics import context_meter
  from distributed.utils import ensure_memoryview, nbytes
label_desc: Use image node_id 1 for calling a global function with example usage: get_compression_settings(key) and returns: compressions