code: def _resnet_layer(
      inputs,
      num_filters=16,
      kernel_size=3,
      strides=1,
      activation="relu",
      batch_norm=True,
      conv_first=True,
      l2_regularization_weight=1e-4,
  ):
      """2D Convolution-Batch Normalization-Activation stack builder.
  
      Args:
        inputs (tensor): input tensor from input image or previous layer
        num_filters (int): Conv2D number of filters
        kernel_size (int): Conv2D square kernel dimensions
        strides (int): Conv2D square stride dimensions
        activation (string): Activation function string.
        batch_norm (bool): whether to include batch normalization
        conv_first (bool): conv-bn-activation (True) or bn-activation-conv (False)
        l2_regularization_weight: The parameter for the L2 regularizer.
  
      Returns:
          x (tensor): tensor as input to the next layer
      """
      conv = tf.keras.layers.Conv2D(
          num_filters,
          kernel_size=kernel_size,
          strides=strides,
          padding="same",
          kernel_initializer="he_normal",
          kernel_regularizer=tf.keras.regularizers.l2(
              l2_regularization_weight
          ),
      )
  
      if batch_norm:
          batch_norm_fn = tf.keras.layers.BatchNormalization()
      else:
          batch_norm_fn = lambda x: x
      if activation is not None:
          activation_fn = tf.keras.layers.Activation(activation)
      else:
          activation_fn = lambda x: x
  
      x = inputs
      if conv_first:
          x = conv(x)
          x = batch_norm_fn(x)
          x = activation_fn(x)
      else:
          x = batch_norm_fn(x)
          x = activation_fn(x)
          x = conv(x)
      return x
  
imports: from absl import logging
  import gin
  import tensorflow.compat.v2
label_desc: Use image node_id 1 for calling a global function with example usage: _resnet_layer(inputs, num_filters, kernel_size, strides, activation, batch_norm, conv_first, l2_regularization_weight) and returns: x