class_docstr: A generic data loader where the samples are arranged in this way: ::
  Args:
      root (string): Root directory path.
      loader (callable): A function to load a sample given its path.
      extensions (list[string]): A list of allowed extensions.
      transform (callable, optional): A function/transform that takes in
          a sample and returns a transformed version.
          E.g, ``transforms.RandomCrop`` for images.
      target_transform (callable, optional): A function/transform that takes
          in the target and transforms it.
   Attributes:
      classes (list): List of the class names.
      class_to_idx (dict): Dict with items (class_name, class_index).
      samples (list): List of (sample path, class_index) tuples
      targets (list): The class_index value for each image in the dataset
class_docstr_tok: ["A","generic","data","loader","where","the","samples","are","arranged","in","this","way",":",":",":","Args",":","root","(","string",")",":","Root","directory","path",".","loader","(","callable",")",":","A","function","to","load","a","sample","given","its","path",".","extensions","(","list","[","string","]",")",":","A","list","of","allowed","extensions",".","transform","(","callable",",","optional",")",":","A","function\/transform","that","takes","in","a","sample","and","returns","a","transformed","version",".","E.g",",","``","transforms.RandomCrop","``","for","images",".","target_transform","(","callable",",","optional",")",":","A","function\/transform","that","takes","in","the","target","and","transforms","it",".","Attributes",":","classes","(","list",")",":","List","of","the","class","names",".","class_to_idx","(","dict",")",":","Dict","with","items","(","class_name",",","class_index",")",".","samples","(","list",")",":","List","of","(","sample","path",",","class_index",")","tuples","targets","(","list",")",":","The","class_index","value","for","each","image","in","the","dataset"]
docstr: Finds the class folders in a dataset.
docstr_tok: ["Finds","the","class","folders","in","a","dataset","."]
code: def _find_classes(self, dir):
      """
      Finds the class folders in a dataset.
      """
      code_to_class = load_class_desc(dir)
      classes = [v for v in code_to_class.values()]
      class_to_idx = {
          code_to_class[k]: i for i, k in enumerate(code_to_class)
      }
      return classes, class_to_idx, code_to_class
  
file_path: robustness/robustness/tools/openimgs_helpers.py
imports: import os
  import csv
  import numpy
  import torch
  import torch.utils.data
  import robustness.data_augmentation
  from robustness import imagenet_models
  from .folder import default_loader, IMG_EXTENSIONS
label_desc: Use image node_id 2 for calling the OIDatasetFolder obj's underlying member method code with example usage: obj._find_classes(dir) and returns: classes,  class_to_idx,  code_to_class