code: def download_url(download_directory: str, url: str) -> str:
      url_path = urllib.parse.urlparse(url).path
      basename = url_path.rsplit("/", 1)[1]
  
      os.makedirs(download_directory, exist_ok=True)
      filepath = os.path.join(download_directory, basename)
      lock = filelock.FileLock(filepath + ".lock")
  
      with lock:
          if not os.path.exists(filepath):
              logging.info("Downloading {} to {}".format(url, filepath))
  
              r = requests.get(url, stream=True)
              with open(filepath, "wb") as f:
                  for chunk in r.iter_content(chunk_size=8192):
                      if chunk:
                          f.write(chunk)
      return filepath
  
file_path: determined/model_hub/model_hub/utils.py
imports: import logging
  import os
  import typing
  import urllib.parse
  from typing import Any, Dict, List, Union
  import filelock
  import numpy
  import requests
  import torch
label_desc: Use image node_id 3 for calling a global function with example usage: download_url(download_directory, url) and returns: filepath