code: def load_from_cache(pretrained_model_name_or_path, s3_dict, **kwargs):
      # Adjusted from HF Transformers to fit loading WordEmbeddings from deepsets s3
      # Load from URL or cache if already cached
      cache_dir = kwargs.pop("cache_dir", None)
      force_download = kwargs.pop("force_download", False)
      resume_download = kwargs.pop("resume_download", False)
      proxies = kwargs.pop("proxies", None)
  
      s3_file = s3_dict[pretrained_model_name_or_path]
      try:
          resolved_file = cached_path(
              s3_file,
              cache_dir=cache_dir,
              force_download=force_download,
              proxies=proxies,
              resume_download=resume_download,
          )
  
          if resolved_file is None:
              raise EnvironmentError
  
      except EnvironmentError:
          if pretrained_model_name_or_path in s3_dict:
              msg = "Couldn't reach server at '{}' to download data.".format(
                  s3_file
              )
          else:
              msg = (
                  "Model name '{}' was not found in model name list. "
                  "We assumed '{}' was a path, a model identifier, or url to a configuration file or "
                  "a directory containing such a file but couldn't find any such file at this path or url.".format(
                      pretrained_model_name_or_path,
                      s3_file,
                  )
              )
          raise EnvironmentError(msg)
  
      if resolved_file == s3_file:
          logger.info("loading file {}".format(s3_file))
      else:
          logger.info(
              "loading file {} from cache at {}".format(
                  s3_file, resolved_file
              )
          )
  
      return resolved_file
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import json
  import logging
  import os
  import tempfile
  import tarfile
  import zipfile
  from functools import wraps
  from hashlib import sha256
  from io import open
  from pathlib import Path
  import boto3
  import numpy
  import requests
  from botocore.exceptions import ClientError
  from dotmap import DotMap
  from tqdm import tqdm
  from transformers.file_utils import cached_path
label_desc: Use image node_id 10 for calling a global function with example usage: load_from_cache(pretrained_model_name_or_path, s3_dict) and returns: resolved_file