code: def average(param_paths: Iterable[str]) -> Dict[str, mx.nd.NDArray]:
      
      all_arg_params = []
      all_aux_params = []
      for path in param_paths:
          logger.info("Loading parameters from '%s'", path)
          arg_params, aux_params = utils.load_params(path)
          all_arg_params.append(arg_params)
          all_aux_params.append(aux_params)
  
      logger.info("%d models loaded", len(all_arg_params))
      utils.check_condition(all(all_arg_params[0].keys() == p.keys() for p in all_arg_params),
                            "arg_param names do not match across models")
      utils.check_condition(all(all_aux_params[0].keys() == p.keys() for p in all_aux_params),
                            "aux_param names do not match across models")
  
      avg_params = {}
      # average arg_params
      for k in all_arg_params[0]:
          arrays = [p[k] for p in all_arg_params]
          avg_params["arg:" + k] = utils.average_arrays(arrays)
      # average aux_params
      for k in all_aux_params[0]:
          arrays = [p[k] for p in all_aux_params]
          avg_params["aux:" + k] = utils.average_arrays(arrays)
  
      return avg_params
docs: Averages parameters from a list of .params file paths.
  
      :param param_paths: List of paths to parameter files.
      :return: Averaged parameter dictionary.