code: def create_skipped_network(
      nn, start_layer, end_layer, pool_layer_type="avg"
  ):
      """Creates a new layer with a skip connection from start_layer to end_layer.
      In a CNN, if the image sizes do not match, this creates additional pooling layers
      (either avg-pool or max-pool) to make them match.
      """
      (
          layer_labels,
          num_units_in_each_layer,
          conn_mat,
          mandatory_child_attributes,
      ) = get_copies_from_old_nn(nn)
      if (
          nn.nn_class != "cnn"
          or nn.post_img_inv_sizes[start_layer]
          == nn.pre_img_inv_sizes[end_layer]
      ):
          conn_mat[start_layer, end_layer] = 1
      else:
          # Determine number of new layers, the number of units and strides in each layer.
          num_new_pool_layers = int(
              np.log2(
                  nn.pre_img_inv_sizes[end_layer]
                  / nn.post_img_inv_sizes[start_layer]
              )
          )
          new_layer_idxs = list(
              range(nn.num_layers, nn.num_layers + num_new_pool_layers)
          )
          num_units_in_each_layer = np.concatenate(
              (num_units_in_each_layer, [None] * num_new_pool_layers)
          )
          mandatory_child_attributes.strides.extend(
              [None] * num_new_pool_layers
          )
          # Determine layer labels
          if pool_layer_type.lower().startswith("avg"):
              new_layer_type = "avg-pool"
          elif pool_layer_type.lower().startswith("max"):
              new_layer_type = "max-pool"
          else:
              raise ValueError(
                  "pool_layer_type should be 'avg' or 'max'."
              )
          new_layer_labels = [
              new_layer_type for _ in range(num_new_pool_layers)
          ]
          layer_labels.extend(new_layer_labels)
          conn_mat = add_layers_to_end_of_conn_mat(
              conn_mat, num_new_pool_layers
          )
          # Finally, the conn_mat
          conn_mat[start_layer, new_layer_idxs[0]] = 1
          conn_mat[new_layer_idxs[-1], end_layer] = 1
          for new_idx in new_layer_idxs[:-1]:
              conn_mat[new_idx, new_idx + 1] = 1
      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 14 for calling a global function with example usage: create_skipped_network(nn, start_layer, end_layer, pool_layer_type) and returns: get_new_nn