code: def make_dataset(dir, class_to_idx, extensions):
      images = []
      dir = os.path.expanduser(dir)
      for target in sorted(class_to_idx.keys()):
          d = os.path.join(dir, target)
          if not os.path.isdir(d):
              continue
  
          for root, _, fnames in sorted(os.walk(d)):
              for fname in sorted(fnames):
                  if has_file_allowed_extension(fname, extensions):
                      path = os.path.join(root, fname)
                      item = (path, class_to_idx[target])
                      images.append(item)
  
      return images
  
imports: import torch.utils.data
  from torch.utils.data import Dataset
  from torchvision import transforms
  from PIL import Image
  import os
  import os.path
  import sys
label_desc: Use image node_id 3 for calling a global function with example usage: make_dataset(dir, class_to_idx, extensions) and returns: images