code: def _resnet(arch, Block, depth, pretrained, **kwargs):
      model = ResNet(Block, depth, **kwargs)
      if pretrained:
          assert (
              arch in model_urls
          ), "{} model do not have a pretrained model now, you should set pretrained=False".format(
              arch
          )
          weight_path = get_weights_path_from_url(model_urls[arch])
  
          param = paddle.load(weight_path)
          model.set_dict(param)
  
      return model
  
imports: from __future__ import division
  from __future__ import print_function
  import paddle
  import paddle.nn
  from paddle.utils.download import get_weights_path_from_url
  from ppdet.core.workspace import register, serializable
  from ..shape_spec import ShapeSpec
label_desc: Use image node_id 1 for calling a global function with example usage: _resnet(arch, Block, depth, pretrained) and returns: model