class_docstr: Graph is high-level Element representing both nodes and edges.
  A Graph may be defined in an abstract form representing just
  the abstract edges between nodes and optionally may be made
  concrete by supplying a Nodes Element defining the concrete
  positions of each node. If the node positions are supplied
  the EdgePaths (defining the concrete edges) can be inferred
  automatically or supplied explicitly.
  
  The constructor accepts regular columnar data defining the edges
  or a tuple of the abstract edges and nodes, or a tuple of the
  abstract edges, nodes, and edgepaths.
class_docstr_tok: ["Graph","is","high-level","Element","representing","both","nodes","and","edges",".","A","Graph","may","be","defined","in","an","abstract","form","representing","just","the","abstract","edges","between","nodes","and","optionally","may","be","made","concrete","by","supplying","a","Nodes","Element","defining","the","concrete","positions","of","each","node",".","If","the","node","positions","are","supplied","the","EdgePaths","(","defining","the","concrete","edges",")","can","be","inferred","automatically","or","supplied","explicitly",".","The","constructor","accepts","regular","columnar","data","defining","the","edges","or","a","tuple","of","the","abstract","edges","and","nodes",",","or","a","tuple","of","the","abstract","edges",",","nodes",",","and","edgepaths","."]
docstr: Allows selecting data by the slices, sets and scalar values
  along a particular dimension. The indices should be supplied as
  keywords mapping between the selected dimension and
  value. Additionally selection_specs (taking the form of a list
  of type.group.label strings, types or functions) may be
  supplied, which will ensure the selection is only applied if the
  specs match the selected object.
  
  Selecting by a node dimensions selects all edges and nodes that are
  connected to the selected nodes. To select only edges between the
  selected nodes set the selection_mode to 'nodes'.
docstr_tok: ["Allows","selecting","data","by","the","slices",",","sets","and","scalar","values","along","a","particular","dimension",".","The","indices","should","be","supplied","as","keywords","mapping","between","the","selected","dimension","and","value",".","Additionally","selection_specs","(","taking","the","form","of","a","list","of","type.group.label","strings",",","types","or","functions",")","may","be","supplied",",","which","will","ensure","the","selection","is","only","applied","if","the","specs","match","the","selected","object",".","Selecting","by","a","node","dimensions","selects","all","edges","and","nodes","that","are","connected","to","the","selected","nodes",".","To","select","only","edges","between","the","selected","nodes","set","the","selection_mode","to","'nodes","'","."]
code: def select(
      self,
      selection_expr=None,
      selection_specs=None,
      selection_mode="edges",
      **selection,
  ):
      """
      Allows selecting data by the slices, sets and scalar values
      along a particular dimension. The indices should be supplied as
      keywords mapping between the selected dimension and
      value. Additionally selection_specs (taking the form of a list
      of type.group.label strings, types or functions) may be
      supplied, which will ensure the selection is only applied if the
      specs match the selected object.
  
      Selecting by a node dimensions selects all edges and nodes that are
      connected to the selected nodes. To select only edges between the
      selected nodes set the selection_mode to 'nodes'.
      """
      from ..util.transform import dim
  
      if selection_expr is not None and not isinstance(
          selection_expr, dim
      ):
          raise ValueError(
              """\
  The first positional argument to the Dataset.select method is expected to be a
  holoviews.util.transform.dim expression. Use the selection_specs keyword
  argument to specify a selection specification"""
          )
  
      selection = {
          dim: sel
          for dim, sel in selection.items()
          if dim in self.dimensions("ranges") + ["selection_mask"]
      }
      if (
          selection_specs
          and not any(self.matches(sp) for sp in selection_specs)
          or (not selection and not selection_expr)
      ):
          return self
  
      index_dim = self.nodes.kdims[2].name
      dimensions = self.kdims + self.vdims
      node_selection = {
          index_dim: v for k, v in selection.items() if k in self.kdims
      }
      if selection_expr:
          mask = selection_expr.apply(
              self.nodes, compute=False, keep_index=True
          )
          nodes = self.nodes[mask]
      else:
          nodes = self.nodes.select(**dict(selection, **node_selection))
      selection = {
          k: v for k, v in selection.items() if k in dimensions
      }
  
      # Compute mask for edges if nodes were selected on
      nodemask = None
      if len(nodes) != len(self.nodes):
          xdim, ydim = dimensions[:2]
          indices = list(nodes.dimension_values(2, False))
          if selection_mode == "edges":
              mask1 = self.interface.select_mask(
                  self, {xdim.name: indices}
              )
              mask2 = self.interface.select_mask(
                  self, {ydim.name: indices}
              )
              nodemask = mask1 | mask2
              nodes = self.nodes
          else:
              nodemask = self.interface.select_mask(
                  self, {xdim.name: indices, ydim.name: indices}
              )
  
      # Compute mask for edge selection
      mask = None
      if selection:
          mask = self.interface.select_mask(self, selection)
  
      # Combine masks
      if nodemask is not None:
          if mask is not None:
              mask &= nodemask
          else:
              mask = nodemask
  
      # Apply edge mask
      if mask is not None:
          data = self.interface.select(self, mask)
          if not np.all(mask):
              new_graph = self.clone((data, nodes))
              source = new_graph.dimension_values(0, expanded=False)
              target = new_graph.dimension_values(1, expanded=False)
              unique_nodes = np.unique(np.concatenate([source, target]))
              nodes = new_graph.nodes[:, :, list(unique_nodes)]
          paths = None
          if self._edgepaths:
              edgepaths = self._split_edgepaths
              paths = edgepaths.clone(
                  edgepaths.interface.select_paths(edgepaths, mask)
              )
              if len(self._edgepaths.data) == 1:
                  paths = paths.clone([paths.dframe()])
      else:
          data = self.data
          paths = self._edgepaths
      return self.clone((data, nodes, paths))
  
imports: from collections import defaultdict
  from types import FunctionType
  import numpy
  import pandas
  import param
  from ..core import Dataset, Dimension, Element2D
  from ..core.accessors import Redim
  from ..core.operation import Operation
  from ..core.util import is_dataframe, max_range, search_indices
  from .chart import Points
  from .path import Path
  from .util import circular_layout, connect_edges_pd, connect_tri_edges_pd, quadratic_bezier, split_path
label_desc: Use image node_id 6 for calling the Graph obj's underlying member method code with example usage: obj.select(selection_expr, selection_specs, selection_mode) and returns: self, self