code: def _check_dict_keys(
      mapping, valid_keys, key_description, valid_key_source
  ):
      """Check that the keys in dictionary are valid against a set list.
  
      Return the input dictionary if it is valid,
      otherwise raise a ValueError with a readable error message.
  
      Parameters
      ----------
      mapping : dict
          The user-provided dict whose keys we want to check.
      valid_keys : iterable
          The valid keys.
      key_description : str
          Description of the keys in ``mapping``, e.g., "channel name(s)" or
          "annotation(s)".
      valid_key_source : str
          Description of the ``valid_keys`` source, e.g., "info dict" or
          "annotations in the data".
  
      Returns
      -------
      mapping
          If all keys are valid the input dict is returned unmodified.
      """
      missing = set(mapping) - set(valid_keys)
      if len(missing):
          _is = "are" if len(missing) > 1 else "is"
          msg = (
              f"Invalid {key_description} {missing} {_is} not present in "
              f"{valid_key_source}"
          )
          raise ValueError(msg)
  
      return mapping
  
imports: import numbers
  import operator
  import os
  import re
  from builtins import input
  from difflib import get_close_matches
  from importlib import import_module
  from pathlib import Path
  import numpy
  from ..defaults import HEAD_SIZE_DEFAULT, _handle_default
  from ..fixes import _compare_version, _median_complex
  from ._logging import _record_warnings, _verbose_safe_false, logger, verbose, warn
label_desc: Use image node_id 36 for calling a global function with example usage: _check_dict_keys(mapping, valid_keys, key_description, valid_key_source) and returns: mapping