code: def _deprecated_model_shim(
      deprecated_name: str,
      current_fn: Callable = None,
      current_tag: str = "",
  ):
      def _fn(pretrained=False, **kwargs):
          assert (
              current_fn is not None
          ), f"Model {deprecated_name} has been removed with no replacement."
          current_name = (
              ".".join([current_fn.__name__, current_tag])
              if current_tag
              else current_fn.__name__
          )
          warnings.warn(
              f"Mapping deprecated model name {deprecated_name} to current {current_name}.",
              stacklevel=2,
          )
          pretrained_cfg = kwargs.pop("pretrained_cfg", None)
          return current_fn(
              pretrained=pretrained,
              pretrained_cfg=pretrained_cfg or current_tag,
              **kwargs,
          )
  
      return _fn
  
imports: import fnmatch
  import re
  import sys
  import warnings
  from collections import defaultdict, deque
  from copy import deepcopy
  from dataclasses import replace
  from typing import Any, Callable, Dict, Iterable, List, Optional, Set, Sequence, Union, Tuple
  from ._pretrained import PretrainedCfg, DefaultCfg
label_desc: Use image node_id 5 for calling a global function with example usage: _deprecated_model_shim(deprecated_name, current_fn, current_tag) and returns: _fn, current_fn