code: def ResidualUnit(
      n_input_filters, stride=1, rate=1, has_branch=False, name=None
  ):
      def bn_name(index):
          return "bn" + name + "_branch" + index
  
      def conv_name(index):
          return "res" + name + "_branch" + index
  
      n_output_filters = 4 * n_input_filters
      main_branch = layers.join(
          # The main purpose of this 1x1 convolution layer is to
          # reduce number of filters. For instance, for the tensor with
          # 256 filters it can be reduced to 64. This trick allows to
          # reduce computation by factor of 4.
          layers.Convolution(
              size=(1, 1, n_input_filters),
              stride=stride,
              bias=None,
              name=conv_name("2a"),
          ),
          layers.BatchNorm(name=bn_name("2a")),
          layers.Relu(),
          # This convolution layer applies 3x3 filter in order to
          # extract features.
          layers.Convolution(
              (3, 3, n_input_filters),
              padding="same",
              dilation=rate,
              bias=None,
              name=conv_name("2b"),
          ),
          layers.BatchNorm(name=bn_name("2b")),
          layers.Relu(),
          # Last layer reverses operations of the first layer. In this
          # case we increase number of filters. For instance, from previously
          # obtained 64 filters we can increase it back to the 256 filters
          layers.Convolution(
              (1, 1, n_output_filters), bias=None, name=conv_name("2c")
          ),
          layers.BatchNorm(name=bn_name("2c")),
      )
  
      if has_branch:
          residual_branch = layers.join(
              layers.Convolution(
                  (1, 1, n_output_filters),
                  stride=stride,
                  bias=None,
                  name=conv_name("1"),
              ),
              layers.BatchNorm(name=bn_name("1")),
          )
      else:
          # Empty list defines residual connection, meaning that
          # output from this branch would be equal to its input
          residual_branch = layers.Identity("residual-" + name)
  
      return layers.join(
          # For the output from two branches we just combine results
          # with simple elementwise sum operation. The main purpose of
          # the residual connection is to build shortcuts for the
          # gradient during backpropagation.
          (main_branch | residual_branch),
          layers.Elementwise(),
          layers.Relu(),
      )
  
imports: from neupy import layers
  from neupy.utils import function_name_scope
label_desc: Use image node_id 1 for calling a global function with example usage: ResidualUnit(n_input_filters, stride, rate, has_branch, name) and returns: layers, unknown, unknown