code: def filename_to_url(filename, cache_dir=None):
      """
      Return the url and etag (which may be ``None``) stored for `filename`.
      Raise ``EnvironmentError`` if `filename` or its stored metadata do not exist.
      """
      if cache_dir is None:
          cache_dir = PYTORCH_PRETRAINED_BERT_CACHE
      if sys.version_info[0] == 3 and isinstance(cache_dir, Path):
          cache_dir = str(cache_dir)
  
      cache_path = os.path.join(cache_dir, filename)
      if not os.path.exists(cache_path):
          raise EnvironmentError("file {} not found".format(cache_path))
  
      meta_path = cache_path + ".json"
      if not os.path.exists(meta_path):
          raise EnvironmentError("file {} not found".format(meta_path))
  
      with open(meta_path, encoding="utf-8") as meta_file:
          metadata = json.load(meta_file)
      url = metadata["url"]
      etag = metadata["etag"]
  
      return url, etag
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import json
  import logging
  import os
  import shutil
  import tempfile
  from functools import wraps
  from hashlib import sha256
  import sys
  from io import open
  import boto3
  import requests
  from botocore.exceptions import ClientError
  from tqdm import tqdm
label_desc: Use image node_id 2 for calling a global function with example usage: filename_to_url(filename, cache_dir) and returns: url,  etag