class_docstr: Baseclass for linked selection functions.
  
  Subclasses override the _build_selection_streams class method to construct
  a _SelectionStreams namedtuple instance that includes the required streams
  for implementing linked selections.
  
  Subclasses also override the _expr_stream_updated method. This allows
  subclasses to control whether new selections override prior selections or
  whether they are combined with prior selections
class_docstr_tok: ["Baseclass","for","linked","selection","functions",".","Subclasses","override","the","_build_selection_streams","class","method","to","construct","a","_SelectionStreams","namedtuple","instance","that","includes","the","required","streams","for","implementing","linked","selections",".","Subclasses","also","override","the","_expr_stream_updated","method",".","This","allows","subclasses","to","control","whether","new","selections","override","prior","selections","or","whether","they","are","combined","with","prior","selections"]
docstr: Transform an input HoloViews object into a dynamic object with linked
  selections enabled.
code: def _selection_transform(self, hvobj, operations=()):
      """
      Transform an input HoloViews object into a dynamic object with linked
      selections enabled.
      """
      from .plotting.util import initialize_dynamic
  
      if isinstance(hvobj, DynamicMap):
          callback = hvobj.callback
          if len(callback.inputs) > 1:
              return Overlay(
                  [
                      self._selection_transform(el)
                      for el in callback.inputs
                  ]
              ).collate()
  
          initialize_dynamic(hvobj)
          if issubclass(hvobj.type, Element):
              self._register(hvobj)
              chart = Store.registry[Store.current_backend][hvobj.type]
              return chart.selection_display(hvobj).build_selection(
                  self._selection_streams,
                  hvobj,
                  operations,
                  self._selection_expr_streams.get(hvobj, None),
                  cache=self._cache,
              )
          elif (
              issubclass(hvobj.type, Overlay)
              and getattr(hvobj.callback, "name", None) == "dynamic_mul"
          ):
              return Overlay(
                  [
                      self._selection_transform(
                          el, operations=operations
                      )
                      for el in callback.inputs
                  ]
              ).collate()
          elif (
              getattr(hvobj.callback, "name", None)
              == "dynamic_operation"
          ):
              obj = callback.inputs[0]
              return self._selection_transform(
                  obj, operations=operations
              ).apply(callback.operation)
          else:
              # This is a DynamicMap that we don't know how to recurse into.
              self.param.warning(
                  "linked selection: Encountered DynamicMap that we don't know "
                  f"how to recurse into:\n{hvobj!r}"
              )
              return hvobj
      elif isinstance(hvobj, Element):
          # Register hvobj to receive selection expression callbacks
          chart = Store.registry[Store.current_backend][type(hvobj)]
          if getattr(chart, "selection_display", None) is not None:
              element = hvobj.clone(link=self.link_inputs)
              self._register(element)
              return chart.selection_display(element).build_selection(
                  self._selection_streams,
                  element,
                  operations,
                  self._selection_expr_streams.get(element, None),
                  cache=self._cache,
              )
          return hvobj
      elif isinstance(
          hvobj, (Layout, Overlay, NdOverlay, GridSpace, AdjointLayout)
      ):
          data = dict(
              [
                  (k, self._selection_transform(v, operations))
                  for k, v in hvobj.items()
              ]
          )
          if isinstance(hvobj, NdOverlay):
  
              def compose(*args, **kwargs):
                  new = []
                  for k, v in data.items():
                      for i, el in enumerate(v[()]):
                          if i == len(new):
                              new.append([])
                          new[i].append((k, el))
                  return Overlay([hvobj.clone(n) for n in new])
  
              new_hvobj = DynamicMap(compose)
              new_hvobj.callback.inputs[:] = list(data.values())
          else:
              new_hvobj = hvobj.clone(data)
              if hasattr(new_hvobj, "collate"):
                  new_hvobj = new_hvobj.collate()
          return new_hvobj
      else:
          # Unsupported object
          return hvobj
  
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 _base_link_selections obj's underlying member method code with example usage: obj._selection_transform(hvobj, operations) and returns: Overlay, chart, hvobj, Overlay, chart, new_hvobj, hvobj, self, hvobj, Overlay