code: def main():
      args = parse_args()
      path = Path(args.save_dir)
      if not path.exists():
          path.mkdir(parents=True, exist_ok=True)
      data2url = dict(
          # TODO: Support for downloading Panoptic Segmentation of COCO
          coco2017=[
              "http://images.cocodataset.org/zips/train2017.zip",
              "http://images.cocodataset.org/zips/val2017.zip",
              "http://images.cocodataset.org/zips/test2017.zip",
              "http://images.cocodataset.org/zips/unlabeled2017.zip",
              "http://images.cocodataset.org/annotations/annotations_trainval2017.zip",  # noqa
              "http://images.cocodataset.org/annotations/stuff_annotations_trainval2017.zip",  # noqa
              "http://images.cocodataset.org/annotations/panoptic_annotations_trainval2017.zip",  # noqa
              "http://images.cocodataset.org/annotations/image_info_test2017.zip",  # noqa
              "http://images.cocodataset.org/annotations/image_info_unlabeled2017.zip",  # noqa
          ],
          coco2014=[
              "http://images.cocodataset.org/zips/train2014.zip",
              "http://images.cocodataset.org/zips/val2014.zip",
              "http://images.cocodataset.org/zips/test2014.zip",
              "http://images.cocodataset.org/annotations/annotations_trainval2014.zip",  # noqa
              "http://images.cocodataset.org/annotations/image_info_test2014.zip",  # noqa
          ],
          lvis=[
              "https://s3-us-west-2.amazonaws.com/dl.fbaipublicfiles.com/LVIS/lvis_v1_train.json.zip",  # noqa
              "https://s3-us-west-2.amazonaws.com/dl.fbaipublicfiles.com/LVIS/lvis_v1_train.json.zip",  # noqa
          ],
          voc2007=[
              "http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtrainval_06-Nov-2007.tar",  # noqa
              "http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtest_06-Nov-2007.tar",  # noqa
              "http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCdevkit_08-Jun-2007.tar",  # noqa
          ],
          voc2012=[
              "http://host.robots.ox.ac.uk/pascal/VOC/voc2012/VOCtrainval_11-May-2012.tar",  # noqa
          ],
          balloon=[
              # src link: https://github.com/matterport/Mask_RCNN/releases/download/v2.1/balloon_dataset.zip # noqa
              "https://download.openmmlab.com/mmyolo/data/balloon_dataset.zip"
          ],
          # Note: There is no download link for Objects365-V1 right now. If you
          # would like to download Objects365-V1, please visit
          # http://www.objects365.org/ to concat the author.
          objects365v2=[
              # training annotations
              "https://dorc.ks3-cn-beijing.ksyun.com/data-set/2020Objects365%E6%95%B0%E6%8D%AE%E9%9B%86/train/zhiyuan_objv2_train.tar.gz",  # noqa
              # validation annotations
              "https://dorc.ks3-cn-beijing.ksyun.com/data-set/2020Objects365%E6%95%B0%E6%8D%AE%E9%9B%86/val/zhiyuan_objv2_val.json",  # noqa
              # training url root
              "https://dorc.ks3-cn-beijing.ksyun.com/data-set/2020Objects365%E6%95%B0%E6%8D%AE%E9%9B%86/train/",  # noqa
              # validation url root_1
              "https://dorc.ks3-cn-beijing.ksyun.com/data-set/2020Objects365%E6%95%B0%E6%8D%AE%E9%9B%86/val/images/v1/",  # noqa
              # validation url root_2
              "https://dorc.ks3-cn-beijing.ksyun.com/data-set/2020Objects365%E6%95%B0%E6%8D%AE%E9%9B%86/val/images/v2/",  # noqa
          ],
          ade20k_2016=[
              # training images and semantic segmentation annotations
              "http://data.csail.mit.edu/places/ADEchallenge/ADEChallengeData2016.zip",  # noqa
              # instance segmentation annotations
              "http://sceneparsing.csail.mit.edu/data/ChallengeData2017/annotations_instance.tar",  # noqa
              # img categories ids
              "https://raw.githubusercontent.com/CSAILVision/placeschallenge/master/instancesegmentation/imgCatIds.json",  # noqa
              # category mapping
              "https://raw.githubusercontent.com/CSAILVision/placeschallenge/master/instancesegmentation/categoryMapping.txt",  # noqa
          ],
          refcoco=[
              # images
              "http://images.cocodataset.org/zips/train2014.zip",
              # refcoco annotations
              "https://bvisionweb1.cs.unc.edu/licheng/referit/data/refcoco.zip",
              # refcoco+ annotations
              "https://bvisionweb1.cs.unc.edu/licheng/referit/data/refcoco+.zip",
              # refcocog annotations
              "https://bvisionweb1.cs.unc.edu/licheng/referit/data/refcocog.zip",
          ],
      )
      url = data2url.get(args.dataset_name, None)
      if url is None:
          print(
              "Only support ADE20K, COCO, RefCOCO, VOC, LVIS, "
              "balloon, and Objects365v2 now!"
          )
          return
      if args.dataset_name == "objects365v2":
          download_objects365v2(
              url,
              dir=path,
              unzip=args.unzip,
              delete=args.delete,
              threads=args.threads,
          )
      else:
          download(
              url,
              dir=path,
              unzip=args.unzip,
              delete=args.delete,
              threads=args.threads,
          )
  
file_path: mmdetection/tools/misc/download_dataset.py
imports: import argparse
  import tarfile
  from itertools import repeat
  from multiprocessing.pool import ThreadPool
  from pathlib import Path
  from tarfile import TarFile
  from zipfile import ZipFile
  import torch
  from mmengine.utils.path import mkdir_or_exist
label_desc: Use image node_id 4 for calling a global function with example usage: main() without return types