code: def update_fields(state, **kwargs):
      """Copies the argument and overrides some of its fields.
  
      Args:
        state: A `collections.namedtuple` instance.
        **kwargs: Other named arguments represent fields in the tuple to override
          with new values.
  
      Returns:
        A namedtuple, of the same class as the input argument, with the updated
        fields.
  
      Raises:
        ValueError if the supplied kwargs contain fields not present in the
        input argument.
      """
      return state._replace(**kwargs)
  
file_path: probability/tensorflow_probability/python/optimizer/bfgs_utils.py
imports: import collections
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.optimizer.linesearch.hager_zhang import hager_zhang
label_desc: Use image node_id 7 for calling a global function with example usage: update_fields(state) and returns: state