code: def _parse_label_dataset(
      root, label_names, check_img_file=_check_img_ext
  ):
      img_paths = []
      labels = []
      for label, label_name in enumerate(label_names):
          label_dir = os.path.join(root, label_name)
          if not os.path.isdir(label_dir):
              continue
  
          walk_dir = sorted(os.walk(label_dir), key=lambda x: x[0])
          for cur_dir, _, names in walk_dir:
              names = sorted(names)
              for name in names:
                  img_path = os.path.join(cur_dir, name)
                  if check_img_file(img_path):
                      img_paths.append(img_path)
                      labels.append(label)
  
      return img_paths, np.array(labels, np.int32)
  
file_path: chainercv/chainercv/datasets/directory_parsing_label_dataset.py
imports: import numpy
  import os
  from chainercv.chainer_experimental.datasets.sliceable import GetterDataset
  from chainercv.utils import read_image
label_desc: Use image node_id 3 for calling a global function with example usage: _parse_label_dataset(root, label_names, check_img_file) and returns: img_paths,  np