code: def wedge_layer(
      nn,
      layer_type,
      units_in_layer,
      layer_before,
      layer_after,
      new_layer_attributes=None,
  ):
      """Wedges a layer of type layer_type after the layer given in layer_before. The
      output of the layer in layer_before goes to the new layer and the output of the
      new layer goes to layer_after. If an edge existed between layer_before and
      layer_after, it is removed."""
      (
          layer_labels,
          num_units_in_each_layer,
          conn_mat,
          mandatory_child_attributes,
      ) = get_copies_from_old_nn(nn)
      layer_labels.append(layer_type)
      num_units_in_each_layer = np.append(
          num_units_in_each_layer, units_in_layer
      )
      if nn.nn_class == "cnn":
          mandatory_child_attributes.strides.append(
              new_layer_attributes.stride
          )
      conn_mat = add_layers_to_end_of_conn_mat(conn_mat, 1)
      conn_mat[layer_before, -1] = 1
      conn_mat[-1, layer_after] = 1
      conn_mat[layer_before, layer_after] = 0
      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 4 for calling a global function with example usage: wedge_layer(nn, layer_type, units_in_layer, layer_before, layer_after, new_layer_attributes) and returns: get_new_nn