code: def _fix_colors(colors):
      colors = np.asarray(colors)
      if colors.ndim not in (2, 3):
          raise ValueError("colors must have 2 or 3 dimensions")
      if colors.shape[-1] not in (3, 4):
          raise ValueError("colors must have 3 or 4 elements")
      if colors.shape[-1] == 3:
          pad = np.ones((len(colors), 1), colors.dtype)
          if colors.ndim == 3:
              pad = pad[:, :, np.newaxis]
          colors = np.concatenate((colors, pad), axis=-1)
      return colors
  
imports: import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: _fix_colors(colors) and returns: colors