code: def test_varying_alpha_palette() -> None:
      assert pal.varying_alpha_palette("blue", 3) == (
          "#0000ff00",
          "#0000ff80",
          "#0000ff",
      )
      assert pal.varying_alpha_palette(
          "red", 3, start_alpha=255, end_alpha=128
      ) == ("#ff0000", "#ff0000c0", "#ff000080")
      assert pal.varying_alpha_palette(
          "#123456", 3, start_alpha=205, end_alpha=205
      ) == ("#123456cd", "#123456cd", "#123456cd")
      assert pal.varying_alpha_palette("#abc", 3) == (
          "#aabbcc00",
          "#aabbcc80",
          "#aabbcc",
      )
  
      palette = pal.varying_alpha_palette("blue")
      assert len(palette) == 256
      assert palette[::64] == (
          "#0000ff00",
          "#0000ff40",
          "#0000ff80",
          "#0000ffc0",
      )
  
      assert pal.varying_alpha_palette(
          "#654321", start_alpha=100, end_alpha=103
      ) == ("#65432164", "#65432165", "#65432166", "#65432167")
  
      with pytest.raises(ValueError):
          pal.varying_alpha_palette("bluey")
      with pytest.raises(ValueError):
          pal.varying_alpha_palette("#8f")
      with pytest.raises(ValueError):
          pal.varying_alpha_palette("red", start_alpha=-1)
      with pytest.raises(ValueError):
          pal.varying_alpha_palette("red", start_alpha=256)
      with pytest.raises(ValueError):
          pal.varying_alpha_palette("red", end_alpha=-1)
      with pytest.raises(ValueError):
          pal.varying_alpha_palette("red", end_alpha=256)
  
      # Combining with alpha from color argument.
      assert pal.varying_alpha_palette("#ffaa8080", 3) == (
          "#ffaa8000",
          "#ffaa8040",
          "#ffaa8080",
      )
      assert pal.varying_alpha_palette(
          "#80ffaa80", 3, start_alpha=255, end_alpha=0
      ) == ("#80ffaa80", "#80ffaa40", "#80ffaa00")
      assert pal.varying_alpha_palette(
          "#aabbcc80", 3, start_alpha=128
      ) == ("#aabbcc40", "#aabbcc60", "#aabbcc80")
      assert pal.varying_alpha_palette(
          "#12345680", 3, start_alpha=0, end_alpha=128
      ) == ("#12345600", "#12345620", "#12345640")
  
      assert len(pal.varying_alpha_palette("#ffaa8080")) == 129
      assert (
          len(pal.varying_alpha_palette("#ffaa8080", end_alpha=128))
          == 65
      )
  
file_path: bokeh/tests/unit/bokeh/test_palettes.py
imports: from __future__ import annotations
  import pytest
  import bokeh.palettes
label_desc: Use image node_id 5 for calling a global function with example usage: test_varying_alpha_palette() without return types