code: def create_imagenet_test_files(input_path: str, output_path: str):
      """
      Create a test split for ImageNet, by reading the image folder in the
      'input_path' and mapping its targets to the targets of imagenet
      """
  
      # Map the images of the image folder to their corresponding targets
      # in ImageNet
      image_paths, image_labels = [], []
      target_mapper = ImagenetTargetMapper()
      target_mappings = target_mapper.get_target_mapping(input_path)
      input_dataset = datasets.ImageFolder(
          root=input_path, loader=lambda x: x
      )
      for image_path, target_id in tqdm(input_dataset):
          image_paths.append(image_path)
          image_labels.append(target_mappings[target_id])
  
      # Save the these lists in the disk_filelist format
      os.makedirs(output_path, exist_ok=True)
      img_info_out_path = os.path.join(output_path, "test_images.npy")
      label_info_out_path = os.path.join(output_path, "test_labels.npy")
      np.save(img_info_out_path, np.array(image_paths))
      np.save(label_info_out_path, np.array(image_labels))
  
file_path: vissl/extra_scripts/datasets/create_imagenet_a_data_files.py
imports: import argparse
  import os
  import numpy
  import torchvision.datasets
  from iopath.common.file_io import g_pathmgr
  from tqdm import tqdm
  from vissl.utils.download import download_and_extract_archive
  from vissl.utils.io import cleanup_dir
label_desc: Use image node_id 4 for calling a global function with example usage: create_imagenet_test_files(input_path, output_path) without return types