class_docstr: Element is the atomic datastructure used to wrap some data with
  an associated visual representation, e.g. an element may
  represent a set of points, an image or a curve. Elements provide
  a common API for interacting with data of different types and
  define how the data map to a set of dimensions and how those
  map to the visual representation.
class_docstr_tok: ["Element","is","the","atomic","datastructure","used","to","wrap","some","data","with","an","associated","visual","representation",",","e.g",".","an","element","may","represent","a","set","of","points",",","an","image","or","a","curve",".","Elements","provide","a","common","API","for","interacting","with","data","of","different","types","and","define","how","the","data","map","to","a","set","of","dimensions","and","how","those","map","to","the","visual","representation","."]
docstr: Samples values at supplied coordinates.
  
  Allows sampling of element with a list of coordinates matching
  the key dimensions, returning a new object containing just the
  selected samples. Supports multiple signatures:
  
  Sampling with a list of coordinates, e.g.:
  
      ds.sample([(0, 0), (0.1, 0.2), ...])
  
  Sampling a range or grid of coordinates, e.g.:
  
      1D: ds.sample(3)
      2D: ds.sample((3, 3))
  
  Sampling by keyword, e.g.:
  
      ds.sample(x=0)
  
  Args:
      samples: List of nd-coordinates to sample
      bounds: Bounds of the region to sample
          Defined as two-tuple for 1D sampling and four-tuple
          for 2D sampling.
      closest: Whether to snap to closest coordinates
      **kwargs: Coordinates specified as keyword pairs
          Keywords of dimensions and scalar coordinates
  
  Returns:
      Element containing the sampled coordinates
code: def sample(
      self, samples=None, bounds=None, closest=False, **sample_values
  ):
      """Samples values at supplied coordinates.
  
      Allows sampling of element with a list of coordinates matching
      the key dimensions, returning a new object containing just the
      selected samples. Supports multiple signatures:
  
      Sampling with a list of coordinates, e.g.:
  
          ds.sample([(0, 0), (0.1, 0.2), ...])
  
      Sampling a range or grid of coordinates, e.g.:
  
          1D: ds.sample(3)
          2D: ds.sample((3, 3))
  
      Sampling by keyword, e.g.:
  
          ds.sample(x=0)
  
      Args:
          samples: List of nd-coordinates to sample
          bounds: Bounds of the region to sample
              Defined as two-tuple for 1D sampling and four-tuple
              for 2D sampling.
          closest: Whether to snap to closest coordinates
          **kwargs: Coordinates specified as keyword pairs
              Keywords of dimensions and scalar coordinates
  
      Returns:
          Element containing the sampled coordinates
      """
      if samples is None:
          samples = []
      raise NotImplementedError
  
imports: from itertools import groupby
  import numpy
  import pandas
  import param
  from .dimension import Dimensioned, ViewableElement, asdim
  from .layout import Composable, Layout, NdLayout
  from .ndmapping import NdMapping
  from .overlay import CompositeOverlay, NdOverlay, Overlayable
  from .spaces import GridSpace, HoloMap
  from .tree import AttrTree
  from .util import get_param_values
label_desc: Use image node_id 8 for calling the Element obj's underlying member method code with example usage: obj.sample(samples, bounds, closest) without return types