code: def _get_candidate_layers_for_modifying_num_units(
      nn, num_candidates="all"
  ):
      """Returns a set of candidate layers for modifying the number of units."""
      modifiable_layers = _get_directly_modifable_layer_idxs(nn)
      if num_candidates == "all" or num_candidates >= len(
          modifiable_layers
      ):
          return modifiable_layers
      else:
          np.random.shuffle(modifiable_layers)
          return modifiable_layers[:num_candidates]
  
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 24 for calling a global function with example usage: _get_candidate_layers_for_modifying_num_units(nn, num_candidates) and returns: modifiable_layers, modifiable_layers