code: def make_res_layer(
      block,
      inplanes,
      planes,
      blocks,
      spatial_stride=1,
      temporal_stride=1,
      dilation=1,
      inflate_freq=1,
      inflate_style="3x1x1",
      nonlocal_freq=1,
      nonlocal_cfg=None,
      norm_layer=BatchNorm,
      norm_kwargs=None,
      layer_name="",
  ):
      """Build each stage of a ResNet"""
      inflate_freq = (
          inflate_freq
          if not isinstance(inflate_freq, int)
          else (inflate_freq,) * blocks
      )
      nonlocal_freq = (
          nonlocal_freq
          if not isinstance(nonlocal_freq, int)
          else (nonlocal_freq,) * blocks
      )
      assert len(inflate_freq) == blocks
      assert len(nonlocal_freq) == blocks
  
      downsample = None
      if spatial_stride != 1 or inplanes != planes * block.expansion:
          downsample = nn.HybridSequential(
              prefix=layer_name + "downsample_"
          )
          with downsample.name_scope():
              downsample.add(
                  nn.Conv3D(
                      in_channels=inplanes,
                      channels=planes * block.expansion,
                      kernel_size=1,
                      strides=(
                          temporal_stride,
                          spatial_stride,
                          spatial_stride,
                      ),
                      use_bias=False,
                  )
              )
              downsample.add(
                  norm_layer(
                      in_channels=planes * block.expansion,
                      **({} if norm_kwargs is None else norm_kwargs),
                  )
              )
  
      layers = nn.HybridSequential(prefix=layer_name)
      cnt = 0
      with layers.name_scope():
          layers.add(
              block(
                  inplanes=inplanes,
                  planes=planes,
                  spatial_stride=spatial_stride,
                  temporal_stride=temporal_stride,
                  dilation=dilation,
                  downsample=downsample,
                  if_inflate=(inflate_freq[0] == 1),
                  inflate_style=inflate_style,
                  if_nonlocal=(nonlocal_freq[0] == 1),
                  nonlocal_cfg=nonlocal_cfg,
                  layer_name="%d_" % cnt,
              )
          )
  
          cnt += 1
          inplanes = planes * block.expansion
          for i in range(1, blocks):
              layers.add(
                  block(
                      inplanes=inplanes,
                      planes=planes,
                      spatial_stride=1,
                      temporal_stride=1,
                      dilation=dilation,
                      if_inflate=(inflate_freq[i] == 1),
                      inflate_style=inflate_style,
                      if_nonlocal=(nonlocal_freq[i] == 1),
                      nonlocal_cfg=nonlocal_cfg,
                      layer_name="%d_" % cnt,
                  )
              )
              cnt += 1
      return layers
  
imports: from mxnet import nd
  from mxnet import init
  from mxnet.context import cpu
  from mxnet.gluon.block import HybridBlock
  from mxnet.gluon import nn
  from mxnet.gluon.nn import BatchNorm
  from ..resnetv1b import resnet50_v1b, resnet101_v1b
  from .non_local import build_nonlocal_block
label_desc: Use image node_id 3 for calling a global function with example usage: make_res_layer(block, inplanes, planes, blocks, spatial_stride, temporal_stride, dilation, inflate_freq, inflate_style, nonlocal_freq, nonlocal_cfg, norm_layer, norm_kwargs, layer_name) and returns: layers