code: def change_num_units_in_layers(
      nn, change_layer_idxs, change_layer_vals
  ):
      """Changes the number of units in change_layer_idxs to change_layer_vals."""
      (
          layer_labels,
          num_units_in_each_layer,
          conn_mat,
          mandatory_child_attributes,
      ) = get_copies_from_old_nn(nn)
      for i, ch_idx in enumerate(change_layer_idxs):
          if is_a_pooling_layer_label(layer_labels[ch_idx]):
              raise ValueError(
                  "Asked to change a pooling layer value. This is not allowed."
              )
          else:
              num_units_in_each_layer[ch_idx] = change_layer_vals[i]
      return get_new_nn(
          nn,
          layer_labels,
          num_units_in_each_layer,
          conn_mat,
          mandatory_child_attributes,
      )
  
imports: from argparse import Namespace
  from copy import deepcopy
  import numpy
  from .neural_network import ConvNeuralNetwork, MultiLayerPerceptron, MLP_RECTIFIERS, MLP_SIGMOIDS, is_a_pooling_layer_label, is_a_conv_layer_label, CNNImageSizeMismatchException, CNNNoConvAfterIPException
  from ..utils.general_utils import reorder_list_or_array, reorder_rows_and_cols_in_matrix
  from ..utils.option_handler import get_option_specs, load_options
  from ..utils.reporters import get_reporter
label_desc: Use image node_id 19 for calling a global function with example usage: change_num_units_in_layers(nn, change_layer_idxs, change_layer_vals) and returns: get_new_nn