code: def update_params(new_params, default, name="optimizer"):
      import copy
  
      params = copy.deepcopy(default)
      if not isinstance(new_params, dict):
          raise ValueError(
              "{} param dict must be a dict but got {}".format(
                  name, new_params
              )
          )
  
      def _update(default, new):
          for key in new.keys():
              if key in default:
                  default[key] = new[key]
  
      _update(params, new_params)
  
      return params
  
imports: import torch.nn
  from fate.arch.dataframe import DataFrame
  from fate.ml.abc.module import HomoModule
  from fate.ml.utils.model_io import ModelIO
  from fate.arch import Context
  import logging
  import torch
  from fate.ml.nn.homo.fedavg import FedAVGClient, TrainingArguments, FedAVGArguments
  from transformers import default_data_collator
  import functools
  import tempfile
  from fate.ml.utils.predict_tools import array_to_predict_df
  from fate.ml.utils.predict_tools import MULTI, BINARY
  from fate.ml.nn.dataset.table import TableDataset
  from fate.ml.utils._optimizer import optimizer_factory, lr_scheduler_factory
label_desc: Use image node_id 5 for calling a global function with example usage: update_params(new_params, default, name) and returns: params