code: def get_palette(num_colors=256):
      
      pallete = [0]*(num_colors*3)
      for j in range(0, num_colors):
          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
docs: generates the colormap for visualizing the segmentation mask
              Args:
                  num_colors (int): the number of colors to generate in the output palette
  
              Returns:
                  string: the supplied extension, if assertion is successful.