code: def merge_hparams(hparams_1, hparams_2):
      """Merge hyperparameters from two tf.contrib.training.HParams objects.
  
      If the same key is present in both HParams objects, the value from `hparams_2`
      will be used.
  
      Args:
        hparams_1: The first tf.contrib.training.HParams object to merge.
        hparams_2: The second tf.contrib.training.HParams object to merge.
  
      Returns:
        A merged tf.contrib.training.HParams object with the hyperparameters from
        both `hparams_1` and `hparams_2`.
      """
      hparams_map = hparams_1.values()
      hparams_map.update(hparams_2.values())
      return contrib_training.HParams(**hparams_map)
  
imports: from magenta.contrib import training
  import tensorflow.compat.v1
label_desc: Use image node_id 1 for calling a global function with example usage: merge_hparams(hparams_1, hparams_2) and returns: contrib_training