code: def _get_blocked_cnn_params(
      num_blocks,
      num_layers_per_block,
      block_layer_type,
      num_fc_layers,
      num_conv_filters_in_layers=None,
      num_fc_nodes_in_layers=None,
      cnn_layer_labels=None,
  ):
      """Returns parameters for a blocked CNN.
      num_blocks: # blocks, i.e. the number of repeated convolutional layers.
      num_layers_per_block: # layers per block.
      num_fc_layers: # fully connected layers.
      num_conv_filters_in_layers: # filters in the layers for each block.
      num_fc_nodes_in_layers: sizes of the fc layers.
      cnn_layer_labels: Labels for all layer types in a CNN.
      """
      layer_labels = ["ip", "conv7", "max-pool"]
      num_filters_each_layer = [None, 64, None]
      strides = [None, 1, None]
      num_conv_filters_in_layers = (
          num_conv_filters_in_layers
          if num_conv_filters_in_layers is not None
          else _dflt_unit_sizes(num_blocks)
      )
      num_fc_nodes_in_layers = (
          num_fc_nodes_in_layers
          if num_fc_nodes_in_layers is not None
          else [2 * num_conv_filters_in_layers[-1]] * num_fc_layers
      )
      cnn_layer_labels = (
          cnn_layer_labels
          if cnn_layer_labels is not None
          else get_cnn_layer_labels()
      )
      # Construct blocks
      for block_idx in range(num_blocks):
          layer_labels.extend(
              [block_layer_type for _ in range(num_layers_per_block)]
          )
          num_filters_each_layer.extend(
              [num_conv_filters_in_layers[block_idx]]
              * num_layers_per_block
          )
          strides.extend([2] + [1] * (num_layers_per_block - 1))
      # Pooling layer after the blocks
      layer_labels.append("avg-pool")
      num_filters_each_layer.append(None)
      strides.append(None)
      # Add FC layers
      layer_labels.extend(
          ["fc" for _ in range(num_fc_layers)] + ["softmax", "op"]
      )
      num_filters_each_layer.extend(
          num_fc_nodes_in_layers + [None, None]
      )
      strides.extend([None] * (num_fc_layers + 2))
      # Construct the connectivity matrix
      num_layers = len(layer_labels)
      conn_mat = get_feedforward_adj_mat(num_layers)
      return (
          layer_labels,
          conn_mat,
          num_filters_each_layer,
          cnn_layer_labels,
          strides,
      )
  
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 7 for calling a global function with example usage: _get_blocked_cnn_params(num_blocks, num_layers_per_block, block_layer_type, num_fc_layers, num_conv_filters_in_layers, num_fc_nodes_in_layers, cnn_layer_labels) and returns: layer_labels,  conn_mat,  num_filters_each_layer,  cnn_layer_labels,  strides