code: def label_colormap(n_label=256, value=None):
      """Label colormap.
  
      Parameters
      ----------
      n_label: int
          Number of labels (default: 256).
      value: float or int
          Value scale or value of label color in HSV space.
  
      Returns
      -------
      cmap: numpy.ndarray, (N, 3), numpy.uint8
          Label id to colormap.
  
      """
  
      def bitget(byteval, idx):
          return (byteval & (1 << idx)) != 0
  
      cmap = np.zeros((n_label, 3), dtype=np.uint8)
      for i in range(0, n_label):
          id = i
          r, g, b = 0, 0, 0
          for j in range(0, 8):
              r = np.bitwise_or(r, (bitget(id, 0) << 7 - j))
              g = np.bitwise_or(g, (bitget(id, 1) << 7 - j))
              b = np.bitwise_or(b, (bitget(id, 2) << 7 - j))
              id = id >> 3
          cmap[i, 0] = r
          cmap[i, 1] = g
          cmap[i, 2] = b
  
      if value is not None:
          hsv = rgb2hsv(cmap.reshape(1, -1, 3))
          if isinstance(value, float):
              hsv[:, 1:, 2] = hsv[:, 1:, 2].astype(float) * value
          else:
              assert isinstance(value, int)
              hsv[:, 1:, 2] = value
          cmap = hsv2rgb(hsv).reshape(-1, 3)
      return cmap
  
imports: import PIL.Image
  import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: label_colormap(n_label, value) and returns: cmap, unknown