code: def _download(file_path: str, url: str, directory: str) -> None:
      logging.info("Downloading weights: %s to %s", url, file_path)
      if not os.path.exists(directory):
          os.makedirs(directory)
      # first check ETag or If-Modified-Since header or similar
      # to check whether updated weights are available?
      r = requests.get(url, stream=True)
      if r.status_code == 200:
          with open(file_path, "wb") as f:
              r.raw.decode_content = True
              shutil.copyfileobj(r.raw, f)
      else:
          raise RuntimeError("Failed to fetch weights from %s", url)
  
file_path: foolbox/foolbox/zoo/weights_fetcher.py
imports: import requests
  import shutil
  import zipfile
  import tarfile
  import os
  import logging
  from .common import sha256_hash, home_directory_path
label_desc: Use image node_id 3 for calling a global function with example usage: _download(file_path, url, directory) without return types