code: def _remap_preact_resnet_model(model_url: str):
      pattern_conv0 = re.compile(r"^(conv0\.\/)(.+)$")
      pattern_block = re.compile(r"^(d\d+)\.(.+)$")
      pattern_layer = re.compile(r"^(.+\.d\d+)\.units\.(\d+)(.+)$")
      pattern_bna = re.compile(r"^(.+\.d\d+)\.blk_bna\.(.+)")
      # download the pretrained weights into torch hub's default dir
      weights_dir = os.path.join(
          torch.hub.get_dir(), "preact-resnet50.pth"
      )
      download_url(
          model_url, fuzzy=True, filepath=weights_dir, progress=False
      )
      state_dict = torch.load(
          weights_dir,
          map_location=None
          if torch.cuda.is_available()
          else torch.device("cpu"),
      )["desc"]
      for key in list(state_dict.keys()):
          new_key = None
          if pattern_conv0.match(key):
              new_key = re.sub(pattern_conv0, r"conv0.conv\2", key)
          elif pattern_block.match(key):
              new_key = re.sub(pattern_block, r"res_blocks.\1.\2", key)
              if pattern_layer.match(new_key):
                  new_key = re.sub(
                      pattern_layer,
                      r"\1.layers.denselayer_\2.layers\3",
                      new_key,
                  )
              elif pattern_bna.match(new_key):
                  new_key = re.sub(
                      pattern_bna, r"\1.bna_block.\2", new_key
                  )
          if new_key:
              state_dict[new_key] = state_dict[key]
              del state_dict[key]
          if "upsample2x" in key:
              del state_dict[key]
  
      return state_dict
  
imports: from __future__ import annotations
  import os
  import re
  import warnings
  from collections import OrderedDict
  from collections.abc import Callable, Sequence
  import torch
  import torch.nn
  from monai.apps.utils import download_url
  from monai.networks.blocks import UpSample
  from monai.networks.layers.factories import Conv, Dropout
  from monai.networks.layers.utils import get_act_layer, get_norm_layer
  from monai.utils.enums import HoVerNetBranch, HoVerNetMode, InterpolateMode, UpsampleMode
  from monai.utils.module import export, look_up_option
label_desc: Use image node_id 2 for calling a global function with example usage: _remap_preact_resnet_model(model_url) and returns: state_dict