code: def get_model_file(
      name, tag=None, root=os.path.join("~", ".mxnet", "models")
  ):
      r"""Return location for the pretrained on local file system.
  
      This function will download from online model zoo when model cannot be found or has mismatch.
      The root directory will be created if it doesn't exist.
  
      Parameters
      ----------
      name : str
          Name of the model.
      root : str, default '~/.mxnet/models'
          Location for keeping the model parameters.
  
      Returns
      -------
      file_path
          Path to the requested pretrained model file.
      """
      if "MXNET_HOME" in os.environ:
          root = os.path.join(os.environ["MXNET_HOME"], "models")
  
      use_tag = isinstance(tag, str)
      if use_tag:
          file_name = "{name}-{short_hash}".format(
              name=name, short_hash=tag
          )
      else:
          file_name = "{name}-{short_hash}".format(
              name=name, short_hash=short_hash(name)
          )
      root = os.path.expanduser(root)
      params_path = os.path.join(root, file_name + ".params")
      lockfile = os.path.join(root, file_name + ".lock")
      if use_tag:
          sha1_hash = tag
      else:
          sha1_hash = _model_sha1[name]
  
      if not os.path.exists(root):
          os.makedirs(root, exist_ok=True)
  
      with portalocker.Lock(
          lockfile,
          timeout=int(os.environ.get("GLUON_MODEL_LOCK_TIMEOUT", 300)),
      ):
          if os.path.exists(params_path):
              if check_sha1(params_path, sha1_hash):
                  return params_path
              else:
                  logging.warning(
                      "Hash mismatch in the content of model file '%s' detected. "
                      "Downloading again.",
                      params_path,
                  )
          else:
              logging.info("Model file not found. Downloading.")
  
          zip_file_path = os.path.join(root, file_name + ".zip")
          repo_url = os.environ.get("MXNET_GLUON_REPO", apache_repo_url)
          if repo_url[-1] != "/":
              repo_url = repo_url + "/"
          download(
              _url_format.format(
                  repo_url=repo_url, file_name=file_name
              ),
              path=zip_file_path,
              overwrite=True,
          )
          with zipfile.ZipFile(zip_file_path) as zf:
              zf.extractall(root)
          os.remove(zip_file_path)
          # Make sure we write the model file on networked filesystems
          try:
              os.sync()
          except AttributeError:
              pass
          if check_sha1(params_path, sha1_hash):
              return params_path
          else:
              raise ValueError(
                  "Downloaded file has different hash. Please try again."
              )
  
file_path: gluon-cv/gluoncv/model_zoo/model_store.py
imports: from __future__ import print_function
  import os
  import zipfile
  import logging
  import portalocker
  from ..utils import download, check_sha1
label_desc: Use image node_id 2 for calling a global function with example usage: get_model_file(name, tag, root) and returns: params_path, params_path