code: def get_single_nn_mutation_op(
      dom,
      dflt_num_steps_probs=None,
      dflt_max_num_steps=None,
      options=None,
      reporter=None,
  ):
      """Returns a mutation operator that will take a single nn and return a mutated version
      of the NN.
      """
  
      # A modifier which works with probabilities
      def _get_single_mutation_from_probs(
          _nn_modifier, _num_steps_probs
      ):
          """Returns a single mutation operator with probs."""
          _num_steps_probs = np.array(_num_steps_probs)
          _num_steps_probs = _num_steps_probs / _num_steps_probs.sum()
          return (
              lambda nn: _nn_modifier.get_modifications_for_a_single_nn(
                  nn, 1, _num_steps_probs
              )[0]
          )
  
      # Create modifier and return
      nn_modifier = NNModifier(
          dom.constraint_checker, options, reporter
      )
      if dflt_num_steps_probs is not None:
          return _get_single_mutation_from_probs(
              nn_modifier, dflt_num_steps_probs
          )
      elif dflt_max_num_steps is not None:
          num_steps_probs = np.zeros((dflt_max_num_steps,))
          num_steps_probs[-1] = 1.0
          return _get_single_mutation_from_probs(
              nn_modifier, num_steps_probs
          )
      else:
          raise ValueError(
              "Specify either dflt_num_steps_probs or dflt_max_num_steps."
          )
  
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 28 for calling a global function with example usage: get_single_nn_mutation_op(dom, dflt_num_steps_probs, dflt_max_num_steps, options, reporter) and returns: function, _get_single_mutation_from_probs, _get_single_mutation_from_probs