code: def colormap_generator(palette):
      # Epsilon ensures float precision doesn't cause issues (#4911)
      epsilon = sys.float_info.epsilon * 10
      return lambda value: palette[
          int(value * (len(palette) - 1) + epsilon)
      ]
  
imports: import sys
  import numpy
  from bokeh.palettes import all_palettes
  from param import concrete_descendents
  from ...core import AdjointLayout, GridMatrix, GridSpace, Layout, NdLayout, NdOverlay, Overlay, Store, config
  from ...core.options import Cycle, Options, Palette
  from ...element import HSV, RGB, Area, Arrow, Bars, Bivariate, Bounds, Box, BoxWhisker, Chord, Contours, Curve, Distribution, Div, EdgePaths, Ellipse, ErrorBars, Graph, HeatMap, HexTiles, Histogram, HLine, HLines, HSpan, HSpans, Image, ImageStack, ItemTable, Labels, Nodes, Path, Points, Polygons, QuadMesh, Raster, Rectangles, Sankey, Scatter, Segments, Slope, Spikes, Spline, Spread, Table, Text, Tiles, TriMesh, VectorField, Violin, VLine, VLines, VSpan, VSpans
  from ..plot import PlotSelector
  from ..util import fire
  from .annotation import ArrowPlot, BoxAnnotationPlot, DivPlot, HLinesAnnotationPlot, HSpansAnnotationPlot, LabelsPlot, LineAnnotationPlot, SlopePlot, SplinePlot, TextPlot, VLinesAnnotationPlot, VSpansAnnotationPlot
  from .callbacks import Callback
  from .chart import AreaPlot, BarPlot, CurvePlot, ErrorPlot, HistogramPlot, PointPlot, SideHistogramPlot, SideSpikesPlot, SpikesPlot, SpreadPlot, VectorFieldPlot
  from .element import ElementPlot, OverlayPlot
  from .geometry import RectanglesPlot, SegmentPlot
  from .graphs import ChordPlot, GraphPlot, NodePlot, TriMeshPlot
  from .heatmap import HeatMapPlot, RadialHeatMapPlot
  from .hex_tiles import HexTilesPlot
  from .links import LinkCallback
  from .path import ContourPlot, PathPlot, PolygonPlot
  from .plot import AdjointLayoutPlot, GridPlot, LayoutPlot
  from .raster import HSVPlot, ImageStackPlot, QuadMeshPlot, RasterPlot, RGBPlot
  from .renderer import BokehRenderer
  from .sankey import SankeyPlot
  from .stats import BivariatePlot, BoxWhiskerPlot, DistributionPlot, ViolinPlot
  from .tabular import TablePlot
  from .tiles import TilePlot
  from .util import bokeh_version
label_desc: Use image node_id 1 for calling a global function with example usage: colormap_generator(palette) and returns: function