code: def get_random_colors(n, name="hsv", hex_format=True):
      """Returns a function that maps each index in 0, 1, ..., n-1 to a distinct
      RGB color; the keyword argument name must be a standard mpl colormap name.
      """
      cmap = plt.cm.get_cmap(name, n)
      result = []
      for i in range(n):
          color = cmap(i)
          if hex_format:
              color = rgb2hex(color)
          result.append(color)
      return np.array(result)
  
imports: from .imports import *
  from subprocess import Popen
label_desc: Use image node_id 38 for calling a global function with example usage: get_random_colors(n, name, hex_format) and returns: np