code: def _find_classes(dir):
      classes = [d.name for d in os.scandir(dir) if d.is_dir()]
      classes.sort()
      class_to_idx = {cls_name: i for i, cls_name in enumerate(classes)}
      return classes, class_to_idx
  
imports: import torch
  import torchvision
  from torchvision.datasets.utils import download_url
  import itertools
  import os
  from torchvision.datasets.utils import download_url
  import os
  import random
  from torchvision.datasets.folder import make_dataset
  from torchvision import transforms
  from torch.utils.data import DataLoader
  import matplotlib.pyplot
  import os
  import shutil
label_desc: Use image node_id 2 for calling a global function with example usage: _find_classes(dir) and returns: classes,  class_to_idx