code: def _getvocpallete(num_cls):
      n = num_cls
      pallete = [0] * (n * 3)
      for j in range(0, n):
          lab = j
          pallete[j * 3 + 0] = 0
          pallete[j * 3 + 1] = 0
          pallete[j * 3 + 2] = 0
          i = 0
          while lab > 0:
              pallete[j * 3 + 0] |= ((lab >> 0) & 1) << (7 - i)
              pallete[j * 3 + 1] |= ((lab >> 1) & 1) << (7 - i)
              pallete[j * 3 + 2] |= ((lab >> 2) & 1) << (7 - i)
              i = i + 1
              lab >>= 3
      return pallete
  
file_path: gluon-cv/gluoncv/utils/viz/segmentation.py
imports: from PIL import Image
  import mxnet
  from mxnet.gluon import HybridBlock
label_desc: Use image node_id 2 for calling a global function with example usage: _getvocpallete(num_cls) and returns: pallete