code: def index_classes(items):
      idx = {}
      for i in items:
          if i[1] not in idx:
              idx[i[1]] = len(idx)
      print("== Found %d classes" % len(idx))
      return idx
  
imports: import torchvision.transforms
  from PIL import Image
  import numpy
  import torch
  import torch.utils.data
  import os
  import os.path
  import errno
label_desc: Use image node_id 2 for calling a global function with example usage: index_classes(items) and returns: idx