code: def get_images_labels_info(split, args):
      assert g_pathmgr.exists(
          args.data_source_dir
      ), "Data source NOT found. Abort!"
      data_dir = f"{args.data_source_dir}/{split}"
      class_idx = get_all_classes(data_dir)
      logger.info(
          "Number of classes in {} data: {}".format(
              split, len(class_idx)
          )
      )
      all_classes = class_idx.keys()
      image_paths, image_classes, img_ids = [], [], []
      for class_name in all_classes:
          class_label = class_idx[class_name]
          class_dir = f"{data_dir}/{class_name}"
          # get all the images in this dir
          for item in os.listdir(class_dir):
              if item not in [".", ".."]:
                  image_paths.append(f"{class_dir}/{item}")
                  img_ids.append(f"{class_name}/{item}")
                  image_classes.append(class_label)
      output_dict = {}
      if args.generate_json:
          for idx in range(len(img_ids)):
              id = img_ids[idx]
              lbl = image_classes[idx]
              output_dict[id] = lbl
      return image_paths, image_classes, output_dict
  
file_path: vissl/extra_scripts/datasets/create_imagenet_data_files.py
imports: import argparse
  import logging
  import os
  import sys
  import numpy
  from iopath.common.file_io import g_pathmgr
label_desc: Use image node_id 2 for calling a global function with example usage: get_images_labels_info(split, args) and returns: image_paths,  image_classes,  output_dict