code: def _validate_hparams(
      hparams_in_dict, required_keys, allowed_keys=None
  ):
      """Validate keys in `hparams_in_dict`.
  
      It asserts all of the `required_keys` are presented in `hparams_in_dict`. It
      also prints all the allowed keys as info. The main purpose is to allow for
      easy debugging, because a mis-spelled allowed key uses the default value
      (e.g., None) silently.
  
      A hparams can contain extra keys other than `required_keys` and `allowed_keys`
      and this function does nothing about them.
  
      Args:
        hparams_in_dict: (dict) A dict with the key in string and value in any type.
        required_keys: (list) A list of strings for required keys.
        allowed_keys: (list) A list of strings for allowed but not requried keys.
  
      Raises:
        ValueError: If any of `required_keys` does not present in `hparams_in_dict`.
      """
      required_keys = required_keys or []
      allowed_keys = allowed_keys or []
      for required_key in required_keys:
          if required_key not in hparams_in_dict:
              raise ValueError(
                  "Required key is missing: '{}'".format(required_key)
              )
      for allowed_key in allowed_keys:
          if allowed_key in hparams_in_dict:
              tf.compat.v1.logging.info(
                  "Allowed key is set: {}={}".format(
                      allowed_key, hparams_in_dict.get(allowed_key)
                  )
              )
          else:
              tf.compat.v1.logging.info(
                  "Allowed key is not set: {}".format(allowed_key)
              )
  
imports: import tensorflow
  from tensorflow import estimator
  from tensorflow.python.util import function_utils
  from tensorflow_ranking.python import feature
  from tensorflow_ranking.python import head
  from tensorflow_ranking.python import losses
  from tensorflow_ranking.python import metrics
  from tensorflow_ranking.python import model
  from tensorflow_ranking.python import utils
label_desc: Use image node_id 1 for calling a global function with example usage: _validate_hparams(hparams_in_dict, required_keys, allowed_keys) without return types