code: def get_list_of_branching_modifiers(nn, num_modifiers=None, **kwargs):
      """Returns a list of operators for Neural networks that create branches in the
      architecture.
      """
      if nn.num_processing_layers == 0:
          # Don't create any branches if there are no processing layers.
          return []
  
      # Define a local function to return the modifier
      def _get_branching_modifier(_path, *_args, **_kwargs):
          """Returns a modifier which duplicates the path along _path."""
          return lambda arg_nn: create_duplicate_branch(
              arg_nn, _path, *_args, **_kwargs
          )
  
      # Some preprocessing
      num_modifiers = (
          num_modifiers
          if num_modifiers is not None
          else 2 * nn.num_layers
      )
      start_layer_prob = (
          _get_start_layer_probs_for_branching_and_skipping(nn)
      )
      ret = []
      if sum(start_layer_prob) <= 0.0:
          return ret  # return immediately with an empty list
      while len(ret) < num_modifiers:
          start_layer_prob = start_layer_prob / sum(start_layer_prob)
          start_layer = int(
              np.random.choice(nn.num_layers, 1, p=start_layer_prob)
          )
          path = _get_path_for_branching_from_start_layer(
              nn, start_layer
          )
          start_layer_prob[
              start_layer
          ] *= 0.9  # shrink probability of picking this layer again.
          ret.append(_get_branching_modifier(path, **kwargs))
      return ret
  
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 13 for calling a global function with example usage: get_list_of_branching_modifiers(nn, num_modifiers) and returns: ret, list, function, ret