code: def _class_to_index(self, mask, _mapping, _key):
      # assert the values
      values = np.unique(mask)
      for i in range(len(values)):
          assert values[i] in _mapping
      index = np.digitize(mask.ravel(), _mapping, right=True)
      return _key[index].reshape(mask.shape)
  
file_path: PaddleSeg/tools/data/convert_voc2010.py
imports: import argparse
  import os
  import tqdm
  import numpy
  from detail import Detail
  from PIL import Image
label_desc: Use image node_id 2 for calling the PascalContextGenerator obj's underlying member method code with example usage: obj._class_to_index(mask, _mapping, _key) and returns: _key