code: def request_file(
      url,
      path,
      proxies=None,
      md5=None,
      raise_for_status=False,
      log_info=True,
      alternate_md5=None,
  ):
      """
      A complete wrapper over download_file() that also make sure the directory of
      `path` exists, and that a file matching the md5 value does not exist.
  
      alternate_md5 allows for an alternate md5 that is acceptable (such as if an older version of a file is okay)
      """
      basedir = Path(path).parent
      ensure_dir(basedir)
      if file_exists(path, md5):
          if log_info:
              logger.info(f"File exists: {path}")
          else:
              logger.debug(f"File exists: {path}")
          return
      # We write data first to a temporary directory,
      # then use os.replace() so that multiple processes
      # running at the same time don't clobber each other
      # with partially downloaded files
      # This was especially common with resources.json
      with tempfile.TemporaryDirectory(dir=basedir) as temp:
          temppath = os.path.join(temp, os.path.split(path)[-1])
          download_file(url, temppath, proxies, raise_for_status)
          os.replace(temppath, path)
      assert_file_exists(path, md5, alternate_md5)
  
imports: from collections import defaultdict, namedtuple
  import errno
  import hashlib
  import json
  import logging
  import os
  from pathlib import Path
  import requests
  import shutil
  import tempfile
  import zipfile
  from tqdm.auto import tqdm
  from stanza.utils.helper_func import make_table
  from stanza.pipeline._constants import TOKENIZE, MWT, POS, LEMMA, DEPPARSE, NER, SENTIMENT
  from stanza.pipeline.registry import PIPELINE_NAMES, PROCESSOR_VARIANTS
  from stanza.resources.default_packages import PACKAGES
  from stanza._version import __resources_version__
label_desc: Use image node_id 8 for calling a global function with example usage: request_file(url, path, proxies, md5, raise_for_status, log_info, alternate_md5) without return types