code: def get_resnet(
      version,
      num_layers,
      pretrained=False,
      ctx=cpu(),
      root="~/.mxnet/models",
      use_se=False,
      **kwargs,
  ):
      r"""ResNet V1 model from `"Deep Residual Learning for Image Recognition"
      <http://arxiv.org/abs/1512.03385>`_ paper.
      ResNet V2 model from `"Identity Mappings in Deep Residual Networks"
      <https://arxiv.org/abs/1603.05027>`_ paper.
  
      Parameters
      ----------
      version : int
          Version of ResNet. Options are 1, 2.
      num_layers : int
          Numbers of layers. Options are 18, 34, 50, 101, 152.
      pretrained : bool or str
          Boolean value controls whether to load the default pretrained weights for model.
          String value represents the hashtag for a certain version of pretrained weights.
      ctx : Context, default CPU
          The context in which to load the pretrained weights.
      root : str, default $MXNET_HOME/models
          Location for keeping the model parameters.
      use_se : bool, default False
          Whether to use Squeeze-and-Excitation module
      norm_layer : object
          Normalization layer used (default: :class:`mxnet.gluon.nn.BatchNorm`)
          Can be :class:`mxnet.gluon.nn.BatchNorm` or :class:`mxnet.gluon.contrib.nn.SyncBatchNorm`.
      norm_kwargs : dict
          Additional `norm_layer` arguments, for example `num_devices=4`
          for :class:`mxnet.gluon.contrib.nn.SyncBatchNorm`.
      """
      assert (
          num_layers in resnet_spec
      ), "Invalid number of layers: %d. Options are %s" % (
          num_layers,
          str(resnet_spec.keys()),
      )
      block_type, layers, channels = resnet_spec[num_layers]
      assert 1 <= version <= 2, (
          "Invalid resnet version: %d. Options are 1 and 2." % version
      )
      resnet_class = resnet_net_versions[version - 1]
      block_class = resnet_block_versions[version - 1][block_type]
      net = resnet_class(
          block_class, layers, channels, use_se=use_se, **kwargs
      )
      if pretrained:
          from .model_store import get_model_file
  
          if not use_se:
              net.load_parameters(
                  get_model_file(
                      "resnet%d_v%d" % (num_layers, version),
                      tag=pretrained,
                      root=root,
                  ),
                  ctx=ctx,
              )
          else:
              net.load_parameters(
                  get_model_file(
                      "se_resnet%d_v%d" % (num_layers, version),
                      tag=pretrained,
                      root=root,
                  ),
                  ctx=ctx,
              )
          from ..data import ImageNet1kAttr
  
          attrib = ImageNet1kAttr()
          net.synset = attrib.synset
          net.classes = attrib.classes
          net.classes_long = attrib.classes_long
      return net
  
imports: from __future__ import division
  from mxnet.context import cpu
  from mxnet.gluon.block import HybridBlock
  from mxnet.gluon import nn
  from mxnet.gluon.nn import BatchNorm
label_desc: Use image node_id 2 for calling a global function with example usage: get_resnet(version, num_layers, pretrained, ctx, root, use_se) and returns: net