code: def block3(
      x,
      filters,
      kernel_size=3,
      stride=1,
      groups=32,
      conv_shortcut=True,
      name=None,
  ):
      """A residual block.
  
      Args:
          x: input tensor.
          filters: integer, filters of the bottleneck layer.
          kernel_size: default 3, kernel size of the bottleneck layer.
          stride: default 1, stride of the first layer.
          groups: default 32, group size for grouped convolution.
          conv_shortcut: default True, use convolution shortcut if True,
              otherwise identity shortcut.
          name: string, block label.
  
      Returns:
          Output tensor for the residual block.
      """
      bn_axis = (
          3
          if keras.backend.image_data_format() == "channels_last"
          else 1
      )
  
      if conv_shortcut is True:
          shortcut = layers.Conv2D(
              (64 // groups) * filters,
              1,
              strides=stride,
              use_bias=False,
              name=f"{name}_0_conv",
          )(x)
  
          shortcut = layers.BatchNormalization(
              axis=bn_axis, epsilon=1.001e-5, name=f"{name}_0_bn"
          )(shortcut)
  
      else:
          shortcut = x
  
      x = layers.Conv2D(
          filters, 1, use_bias=False, name=f"{name}_1_conv"
      )(x)
      x = layers.BatchNormalization(
          axis=bn_axis, epsilon=1.001e-5, name=f"{name}_1_bn"
      )(x)
  
      x = layers.Activation("relu", name=f"{name}_1_relu")(x)
  
      c = filters // groups
      x = layers.ZeroPadding2D(
          padding=((1, 1), (1, 1)), name=f"{name}_2_pad"
      )(x)
      x = layers.DepthwiseConv2D(
          kernel_size,
          strides=stride,
          depth_multiplier=c,
          use_bias=False,
          name=f"{name}_2_conv",
      )(x)
  
      if bn_axis == 3:
          x_shape = ops.shape(x)[1:-1]
          x = layers.Reshape(x_shape + (groups, c, c))(x)
          output_shape = x_shape + (groups, c)
          x = layers.Lambda(
              lambda x: sum(x[:, :, :, :, i] for i in range(c)),
              name=f"{name}_2_reduce",
              output_shape=output_shape,
          )(x)
  
          x = layers.Reshape(x_shape + (filters,))(x)
      else:
          x_shape = ops.shape(x)[2:]
          x = layers.Reshape((groups, c, c) + x_shape)(x)
          output_shape = (groups, c) + x_shape
          x = layers.Lambda(
              lambda x: sum(x[:, :, i, :, :] for i in range(c)),
              name=f"{name}_2_reduce",
              output_shape=output_shape,
          )(x)
  
          x = layers.Reshape((filters,) + x_shape)(x)
  
      x = layers.BatchNormalization(
          axis=bn_axis, epsilon=1.001e-5, name=f"{name}_2_bn"
      )(x)
  
      x = layers.Activation("relu", name=f"{name}_2_relu")(x)
  
      x = layers.Conv2D(
          (64 // groups) * filters,
          1,
          use_bias=False,
          name=f"{name}_3_conv",
      )(x)
  
      x = layers.BatchNormalization(
          axis=bn_axis, epsilon=1.001e-5, name=f"{name}_3_bn"
      )(x)
  
      x = layers.Add(name=f"{name}_add")([shortcut, x])
      x = layers.Activation("relu", name=f"{name}_out")(x)
      return x
  
file_path: keras-tuner/keras_tuner/applications/resnet.py
imports: from keras_tuner.api_export import keras_tuner_export
  from keras_tuner.backend import keras
  from keras_tuner.backend import ops
  from keras_tuner.backend.keras import layers
  from keras_tuner.engine import hypermodel
label_desc: Use image node_id 5 for calling a global function with example usage: block3(x, filters, kernel_size, stride, groups, conv_shortcut, name) and returns: x