code: def block_layer(
      inputs,
      filters,
      block_fn,
      blocks,
      strides,
      is_training,
      name,
      data_format="channels_first",
      use_td=False,
      targeting_rate=None,
      keep_prob=None,
      bottleneck_ratio=4,
  ):
      """Creates one layer of blocks for the ResNet model.
  
      Args:
        inputs: `Tensor` of size `[batch, channels, height, width]`.
        filters: `int` number of filters for the first convolution of the layer.
        block_fn: `function` for the block to use within the model
        blocks: `int` number of blocks contained in the layer.
        strides: `int` stride to use for the first convolution of the layer. If
            greater than 1, this layer will downsample the input.
        is_training: `bool` for whether the model is training.
        name: `str`name for the Tensor output of the block layer.
        data_format: `str` either "channels_first" for `[batch, channels, height,
            width]` or "channels_last for `[batch, height, width, channels]`.
        use_td: `str` one of "weight" or "unit". Set to False or "" to disable
          targeted dropout.
        targeting_rate: `float` proportion of weights to target with targeted
          dropout.
        keep_prob: `float` keep probability for targeted dropout.
        bottleneck_ratio: `int`, how much we scale up filters in bottleneck block.
  
      Returns:
        The output `Tensor` of the block layer.
      """
      # Bottleneck blocks end with bottleneck_ratio x the number of filters
      filters_out = filters
      if block_fn is bottleneck_block:
          filters_out = bottleneck_ratio * filters
  
      def projection_shortcut(inputs):
          """Project identity branch."""
          inputs = conv2d_fixed_padding(
              inputs=inputs,
              filters=filters_out,
              kernel_size=1,
              strides=strides,
              data_format=data_format,
              use_td=use_td,
              targeting_rate=targeting_rate,
              keep_prob=keep_prob,
              is_training=is_training,
          )
          return batch_norm_relu(
              inputs, is_training, relu=False, data_format=data_format
          )
  
      # Only the first block per block_layer uses projection_shortcut and strides
      inputs = block_fn(
          inputs,
          filters,
          is_training,
          projection_shortcut,
          strides,
          False,
          data_format,
          use_td=use_td,
          targeting_rate=targeting_rate,
          keep_prob=keep_prob,
          bottleneck_ratio=bottleneck_ratio,
      )
  
      for i in range(1, blocks):
          inputs = block_fn(
              inputs,
              filters,
              is_training,
              None,
              1,
              (i + 1 == blocks),
              data_format,
              use_td=use_td,
              targeting_rate=targeting_rate,
              keep_prob=keep_prob,
              bottleneck_ratio=bottleneck_ratio,
          )
  
      return tf.identity(inputs, name)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from tensor2tensor.layers import common_hparams
  from tensor2tensor.layers import common_layers
  from tensor2tensor.utils import hparam
  from tensor2tensor.utils import registry
  from tensor2tensor.utils import t2t_model
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
label_desc: Use image node_id 7 for calling a global function with example usage: block_layer(inputs, filters, block_fn, blocks, strides, is_training, name, data_format, use_td, targeting_rate, keep_prob, bottleneck_ratio) and returns: tf, batch_norm_relu