code: def copy_hparams(hparams):
      hp_vals = hparams.values()
      new_hparams = hparam.HParams(**hp_vals)
      other_attrs = ["problem", "problem_hparams"]
      for attr in other_attrs:
          attr_val = getattr(hparams, attr, None)
          if attr_val is not None:
              setattr(new_hparams, attr, attr_val)
      return new_hparams
  
file_path: tensor2tensor/tensor2tensor/utils/hparams_lib.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import json
  from tensor2tensor.data_generators import problem
  from tensor2tensor.utils import hparam
  from tensor2tensor.utils import registry
  import tensorflow.compat.v1
label_desc: Use image node_id 1 for calling a global function with example usage: copy_hparams(hparams) and returns: new_hparams