code: def get_nn_modifier_from_args(
      constraint_checker,
      dflt_num_steps_probs=None,
      dflt_max_num_steps=None,
      options=None,
      reporter=None,
  ):
      """Returns a function which can be used to modify neural networks."""
  
      # A modifier which works with probabilities
      def _get_modifier_with_probs(_nn_modifier, _num_steps_probs):
          """Returns a modifier with probs."""
          _num_steps_probs = np.array(_num_steps_probs)
          _num_steps_probs = _num_steps_probs / _num_steps_probs.sum()
          return lambda list_of_nns, num_modifications, **kwargs: _nn_modifier(
              list_of_nns,
              num_modifications,
              num_steps_probs=_num_steps_probs,
              max_num_steps=None,
              **kwargs,
          )
  
      # A modifier which works with max_num_steps
      def _get_modifier_with_steps(_nn_modifier, _max_num_steps):
          """Returns a modifier with max_num_steps."""
          return lambda list_of_nns, num_modifications, **kwargs: _nn_modifier(
              list_of_nns,
              num_modifications,
              num_steps_probs=None,
              max_num_steps=_max_num_steps,
              **kwargs,
          )
  
      # Construct a Modifier
      nn_modifier = NNModifier(constraint_checker, options, reporter)
      if dflt_num_steps_probs is not None:
          return _get_modifier_with_probs(
              nn_modifier, dflt_num_steps_probs
          )
      elif dflt_max_num_steps is not None:
          return _get_modifier_with_steps(
              nn_modifier, dflt_max_num_steps
          )
      else:
          return nn_modifier
  
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 27 for calling a global function with example usage: get_nn_modifier_from_args(constraint_checker, dflt_num_steps_probs, dflt_max_num_steps, options, reporter) and returns: function, function, _get_modifier_with_probs, _get_modifier_with_steps, nn_modifier