class_docstr: Selection display base class that represents selections by overlaying
  colored subsets on top of the original element in an Overlay container.
class_docstr_tok: ["Selection","display","base","class","that","represents","selections","by","overlaying","colored","subsets","on","top","of","the","original","element","in","an","Overlay","container","."]
code: def _build_layer_callback(
      self, element, exprs, layer_number, cmap, cache, **kwargs
  ):
      selection = self._select(element, exprs[layer_number], cache)
      pipeline = element.pipeline
      if cmap is not None:
          pipeline = self._inject_cmap_in_pipeline(pipeline, cmap)
      if element is selection:
          return pipeline(element.dataset)
      else:
          return pipeline(selection)
  
imports: from collections import namedtuple
  import numpy
  import param
  from param.parameterized import bothmethod
  from .core.data import Dataset
  from .core.element import Element, Layout
  from .core.layout import AdjointLayout
  from .core.options import CallbackError, Store
  from .core.overlay import NdOverlay, Overlay
  from .core.spaces import GridSpace
  from .streams import CrossFilterSet, Derived, Pipe, PlotReset, SelectionExprSequence, SelectMode, Stream
  from .util import DynamicMap
label_desc: Use image node_id 5 for calling the OverlaySelectionDisplay obj's underlying member method code with example usage: obj._build_layer_callback(element, exprs, layer_number, cmap, cache) and returns: pipeline, pipeline