code: def download_file_by_url(
      url, output_directory, output_file_name, file_format=None
  ):
      """Download file/compressed file by url.
  
      Args:
          url (string): URL of the object to download
          output_directory (string, optional): Full path where object will be saved
                                               Abosolute path recommended. Relative path also works.
          output_file_name (string, optional): File name which object will be saved as
          file_format (string, optional): File format
                                  For compressed file, support ["tar.xz", "tar", "tar.gz", "tgz", "gz", "zip"]
  
      Example: (Grab the raw link from GitHub. Notice that using "raw" in the URL.)
          >>> url = "https://github.com/pykale/data/raw/main/videos/video_test_data/ADL/annotations/labels_train_test/adl_P_04_train.pkl"
          >>> download_file_by_url(url, "data", "a.pkl", "pkl")
  
          >>> url = "https://github.com/pykale/data/raw/main/videos/video_test_data.zip"
          >>> download_file_by_url(url, "data", "video_test_data.zip", "zip")
  
      """
  
      output_directory = Path(output_directory).absolute()
      file = Path(output_directory).joinpath(output_file_name)
      if os.path.exists(file):
          logging.info("Skipping Download and Extraction")
  
          return
      if not os.path.exists(output_directory):
          os.makedirs(output_directory)
  
      if file_format in ["tar.xz", "tar", "tar.gz", "tgz", "gz", "zip"]:
          logging.info(
              "Downloading and extracting {}.".format(output_file_name)
          )
  
          download_and_extract_archive(
              url=url,
              download_root=output_directory,
              filename=output_file_name,
          )
          logging.info(
              "Datasets downloaded and extracted in {}".format(file)
          )
      else:
          logging.info("Downloading {}.".format(output_file_name))
          download_url_to_file(url, file)
          logging.info("Datasets downloaded in {}".format(file))
  
imports: import logging
  import os
  from pathlib import Path
  from torch.hub import download_url_to_file
  from torchvision.datasets.utils import download_and_extract_archive, download_file_from_google_drive, extract_archive
label_desc: Use image node_id 1 for calling a global function with example usage: download_file_by_url(url, output_directory, output_file_name, file_format) without return types