code: def get_blocked_mlp(
      class_or_reg,
      num_blocks,
      num_layers_per_block=None,
      num_units_in_each_layer=None,
  ):
      """Creates a blocked MLP."""
      # Create rectifiers and sigmoids
      rectifiers = ["relu", "elu", "crelu", "leaky-relu", "softplus"]
      sigmoids = ["logistic", "tanh"]
      obtl_label = "linear" if class_or_reg == "reg" else "softmax"
      np.random.shuffle(rectifiers)
      np.random.shuffle(sigmoids)
      rect_count = 0
      sig_count = 0
      # Preprocess args
      # Create the network
      layer_labels = ["ip"]
      num_units_in_each_layer = (
          num_units_in_each_layer
          if num_units_in_each_layer is not None
          else _dflt_unit_sizes(num_blocks)
      )
      # Construct blocks
      for block_idx in range(num_blocks):
          if block_idx % 2 == 0:
              layer_type = rectifiers[rect_count % len(rectifiers)]
              rect_count += 1
          else:
              layer_type = sigmoids[sig_count % len(sigmoids)]
              sig_count += 1
          layer_labels.extend([layer_type] * num_layers_per_block)
          num_units_in_each_layer.extend(
              [num_units_in_each_layer[block_idx]]
              * num_layers_per_block
          )
      # A linear layer at the end of the block
      layer_labels.extend([obtl_label, "op"])
      num_units_in_each_layer.extend([None, None])
      conn_mat = get_feedforward_adj_mat(len(layer_labels))
      all_layer_labels = get_mlp_layer_labels(class_or_reg)
      return MultiLayerPerceptron(
          class_or_reg,
          layer_labels,
          conn_mat,
          num_units_in_each_layer,
          all_layer_labels,
      )
  
imports: import numpy
  from scipy.sparse import dok_matrix
  from .neural_network import ConvNeuralNetwork, MultiLayerPerceptron, get_cnn_layer_labels, get_mlp_layer_labels, is_a_conv_layer_label
  from .nn_modifiers import NNModifier
  from ..utils.general_utils import get_dok_mat_with_set_coords
label_desc: Use image node_id 10 for calling a global function with example usage: get_blocked_mlp(class_or_reg, num_blocks, num_layers_per_block, num_units_in_each_layer) and returns: MultiLayerPerceptron