code: def get_preresnet(
      blocks,
      conv1_stride=True,
      width_scale=1.0,
      model_name=None,
      pretrained=False,
      root=os.path.join("~", ".torch", "models"),
      **kwargs,
  ):
      """
      Create PreResNet model with specific parameters.
  
      Parameters:
      ----------
      blocks : int
          Number of blocks.
      conv1_stride : bool
          Whether to use stride in the first or the second convolution layer in units.
      width_scale : float
          Scale factor for width of layers.
      model_name : str or None, default None
          Model name for loading pretrained model.
      pretrained : bool, default False
          Whether to load the pretrained weights for model.
      root : str, default '~/.torch/models'
          Location for keeping the model parameters.
      """
  
      if blocks == 10:
          layers = [1, 1, 1, 1]
      elif blocks == 12:
          layers = [2, 1, 1, 1]
      elif blocks == 14:
          layers = [2, 2, 1, 1]
      elif blocks == 16:
          layers = [2, 2, 2, 1]
      elif blocks == 18:
          layers = [2, 2, 2, 2]
      elif blocks == 34:
          layers = [3, 4, 6, 3]
      elif blocks == 50:
          layers = [3, 4, 6, 3]
      elif blocks == 101:
          layers = [3, 4, 23, 3]
      elif blocks == 152:
          layers = [3, 8, 36, 3]
      elif blocks == 200:
          layers = [3, 24, 36, 3]
      else:
          raise ValueError(
              "Unsupported ResNet with number of blocks: {}".format(
                  blocks
              )
          )
  
      init_block_channels = 64
  
      if blocks < 50:
          channels_per_layers = [64, 128, 256, 512]
          bottleneck = False
      else:
          channels_per_layers = [256, 512, 1024, 2048]
          bottleneck = True
  
      channels = [
          [ci] * li for (ci, li) in zip(channels_per_layers, layers)
      ]
  
      if width_scale != 1.0:
          channels = [
              [int(cij * width_scale) for cij in ci] for ci in channels
          ]
          init_block_channels = int(init_block_channels * width_scale)
  
      net = PreResNet(
          channels=channels,
          init_block_channels=init_block_channels,
          bottleneck=bottleneck,
          conv1_stride=conv1_stride,
          **kwargs,
      )
  
      if pretrained:
          if (model_name is None) or (not model_name):
              raise ValueError(
                  "Parameter `model_name` should be properly initialized for loading pretrained model."
              )
          import torch
          from .model_store import get_model_file
  
          net.load_state_dict(
              torch.load(
                  get_model_file(
                      model_name=model_name,
                      local_model_store_dir_path=root,
                  )
              )
          )
  
      return net
  
imports: import numpy
  import torch
  from torch.autograd import Variable
  from pytorch2keras.converter import pytorch_to_keras
  import os
  import torch.nn
  import torch.nn.init
label_desc: Use image node_id 4 for calling a global function with example usage: get_preresnet(blocks, conv1_stride, width_scale, model_name, pretrained, root) and returns: net