code: def make_res_layer(
      block,
      inplanes,
      planes,
      blocks,
      spatial_stride=1,
      temporal_stride=1,
      dilation=1,
      style="pytorch",
      inflate_freq=1,
      inflate_style="3x1x1",
      nonlocal_freq=1,
      nonlocal_cfg=None,
      with_cp=False,
  ):
      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.Sequential(
              nn.Conv3d(
                  inplanes,
                  planes * block.expansion,
                  kernel_size=1,
                  stride=(
                      temporal_stride,
                      spatial_stride,
                      spatial_stride,
                  ),
                  bias=False,
              ),
              nn.BatchNorm3d(planes * block.expansion),
          )
  
      layers = []
      layers.append(
          block(
              inplanes,
              planes,
              spatial_stride,
              temporal_stride,
              dilation,
              downsample,
              style=style,
              if_inflate=(inflate_freq[0] == 1),
              inflate_style=inflate_style,
              if_nonlocal=(nonlocal_freq[0] == 1),
              nonlocal_cfg=nonlocal_cfg,
              with_cp=with_cp,
          )
      )
      inplanes = planes * block.expansion
      for i in range(1, blocks):
          layers.append(
              block(
                  inplanes,
                  planes,
                  1,
                  1,
                  dilation,
                  style=style,
                  if_inflate=(inflate_freq[i] == 1),
                  inflate_style=inflate_style,
                  if_nonlocal=(nonlocal_freq[i] == 1),
                  nonlocal_cfg=nonlocal_cfg,
                  with_cp=with_cp,
              )
          )
  
      return nn.Sequential(*layers)
  
imports: import torch
  import torch.nn
  import torch.utils.checkpoint
  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, style, inflate_freq, inflate_style, nonlocal_freq, nonlocal_cfg, with_cp) and returns: nn