code: def download_data(
      dataset,
      video_ids,
      dataset_splits,
      download_dir,
      keep_zip,
      raw_dataset_assets,
      should_download_laser_scanner_point_cloud,
  ):
      metadata = get_metadata(dataset, download_dir)
      if None is metadata:
          print(f"Error retrieving metadata for dataset {dataset}")
          return
  
      download_dir = os.path.abspath(download_dir)
      for video_id in sorted(set(video_ids)):
          split = dataset_splits[video_ids.index(video_id)]
          dst_dir = os.path.join(download_dir, dataset, split)
          if dataset == "raw":
              url_prefix = ""
              file_names = []
              if not raw_dataset_assets:
                  print(
                      f"Warning: No raw assets given for video id {video_id}"
                  )
              else:
                  dst_dir = os.path.join(dst_dir, str(video_id))
                  url_prefix = (
                      f"{ARkitscense_url}/raw/{split}/{video_id}"
                      + "/{}"
                  )
                  file_names = raw_files(
                      video_id, raw_dataset_assets, metadata
                  )
          elif dataset == "3dod":
              url_prefix = f"{ARkitscense_url}/threedod/{split}" + "/{}"
              file_names = [
                  f"{video_id}.zip",
              ]
          elif dataset == "upsampling":
              url_prefix = (
                  f"{ARkitscense_url}/upsampling/{split}" + "/{}"
              )
              file_names = [
                  f"{video_id}.zip",
              ]
          else:
              raise Exception(f"No such dataset = {dataset}")
  
          if (
              should_download_laser_scanner_point_cloud
              and dataset == "raw"
          ):
              # Point clouds only available for the raw dataset
              download_laser_scanner_point_clouds_for_video(
                  video_id, metadata, download_dir
              )
  
          for file_name in file_names:
              dst_path = os.path.join(dst_dir, file_name)
              url = url_prefix.format(file_name)
  
              if not file_name.endswith(".zip") or not os.path.isdir(
                  dst_path[: -len(".zip")]
              ):
                  download_file(url, dst_path, dst_dir)
              else:
                  print(
                      f"WARNING: skipping download of existing zip file: {dst_path}"
                  )
              if file_name.endswith(".zip") and os.path.isfile(
                  dst_path
              ):
                  unzip_file(file_name, dst_dir, keep_zip)
  
      if dataset == "upsampling" and VALIDATION in dataset_splits:
          val_attributes_file = "val_attributes.csv"
          url = f"{ARkitscense_url}/upsampling/{VALIDATION}/{val_attributes_file}"
          dst_file = os.path.join(download_dir, dataset, VALIDATION)
          download_file(url, val_attributes_file, dst_file)
  
file_path: ARKitScenes/download_data.py
imports: import argparse
  import subprocess
  import pandas
  import math
  import os
label_desc: Use image node_id 8 for calling a global function with example usage: download_data(dataset, video_ids, dataset_splits, download_dir, keep_zip, raw_dataset_assets, should_download_laser_scanner_point_cloud) without return types