code: def _get_z_colorbar_data(z_data=None, values=None, colors=None):
      if values is None:
          values = [0, 1.0 / 10, 2.0 / 10, 6.0 / 10, 9.0 / 10]
      if colors is None:
          colors = [
              (71, 17, 100),
              (53, 92, 140),
              (37, 139, 141),
              (66, 189, 112),
              (141, 314, 68),
              (221, 226, 24),
          ]
      if z_data is not None:
          data = np.array(z_data)
          max_z = data.max()
          scaler = max_z
          values = [float(v * scaler) for v in values[0:5]]
      values.append(1.0)  # poltly quirk?
      # we do not want to show the first and last value
      tickvalues = [" %.3f " % v for v in values[1:]]
      tickvalues = [float(v) for v in tickvalues]
      # tickvalues.pop()
      colorscale = [
          [v, "rgb" + str(color)] for v, color in zip(values, colors)
      ]
      colorbar = {
          "tick0": 0,
          "tickmode": "array",
          "tickvals": tickvalues,
      }
  
      return colorscale, colorbar
  
imports: import json
  import numpy
  from ..errors import UsageError
  from ..utilities.dicts import merge_dicts
  from attr import attrs, attrib
label_desc: Use image node_id 9 for calling a global function with example usage: _get_z_colorbar_data(z_data, values, colors) and returns: colorscale,  colorbar