code: def prepare_hparams(yaml_file=None, **kwargs):
      """Prepare the model hyperparameters and check that all have the correct value.
  
      Args:
          yaml_file (str): YAML file as configuration.
  
      Returns:
          HParams: Hyperparameter object.
      """
      if yaml_file is not None:
          config = load_yaml(yaml_file)
          config = flat_config(config)
      else:
          config = {}
  
      config.update(kwargs)
  
      check_nn_config(config)
      return create_hparams(config)
  
file_path: recommenders/recommenders/models/newsrec/newsrec_utils.py
imports: from recommenders.models.deeprec.deeprec_utils import flat_config, HParams, load_yaml
  import random
  import re
label_desc: Use image node_id 4 for calling a global function with example usage: prepare_hparams(yaml_file) and returns: create_hparams