class_docstr: Operation which automatically links selections between elements
  in the supplied HoloViews object. Can be used a single time or
  be used as an instance to apply the linked selections across
  multiple objects.
class_docstr_tok: ["Operation","which","automatically","links","selections","between","elements","in","the","supplied","HoloViews","object",".","Can","be","used","a","single","time","or","be","used","as","an","instance","to","apply","the","linked","selections","across","multiple","objects","."]
docstr: Filters the provided data based on the current state of the
  current selection expression.
  
  Args:
      data: A Dataset type or data which can be cast to a Dataset
      selection_expr: Optionally provide your own selection expression
  
  Returns:
      The filtered data
code: def filter(self, data, selection_expr=None):
      """
      Filters the provided data based on the current state of the
      current selection expression.
  
      Args:
          data: A Dataset type or data which can be cast to a Dataset
          selection_expr: Optionally provide your own selection expression
  
      Returns:
          The filtered data
      """
      expr = (
          self.selection_expr
          if selection_expr is None
          else selection_expr
      )
      if expr is None:
          return data
      is_dataset = isinstance(data, Dataset)
      if not is_dataset:
          data = Dataset(data)
      filtered = data[expr.apply(data)]
      return filtered if is_dataset else filtered.data
  
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 4 for calling the link_selections obj's underlying member method code with example usage: obj.filter(data, selection_expr) and returns: unknown, data