code: def test_diverging_palette(self):
      h_neg, h_pos = 100, 200
      sat, lum = 70, 50
      args = h_neg, h_pos, sat, lum
  
      n = 12
      pal = palettes.diverging_palette(*args, n=n)
      neg_pal = palettes.light_palette(
          (h_neg, sat, lum), int(n // 2), input="husl"
      )
      pos_pal = palettes.light_palette(
          (h_pos, sat, lum), int(n // 2), input="husl"
      )
      assert len(pal) == n
      assert pal[0] == neg_pal[-1]
      assert pal[-1] == pos_pal[-1]
  
      pal_dark = palettes.diverging_palette(*args, n=n, center="dark")
      assert np.mean(pal[int(n / 2)]) > np.mean(pal_dark[int(n / 2)])
  
      pal_cmap = palettes.diverging_palette(*args, as_cmap=True)
      assert isinstance(pal_cmap, mpl.colors.LinearSegmentedColormap)
  
imports: import colorsys
  import numpy
  import matplotlib
  import pytest
  import numpy.testing
  from seaborn import palettes, utils, rcmod
  from seaborn.external import husl
  from seaborn._compat import get_colormap
  from seaborn.colors import xkcd_rgb, crayons
label_desc: Use image node_id 25 for calling the TestColorPalettes obj's underlying member method code with example usage: obj.test_diverging_palette() without return types