class_docstr: The DaskInterface allows a Dataset objects to wrap a dask
  DataFrame object. Using dask allows loading data lazily
  and performing out-of-core operations on the data, making
  it possible to work on datasets larger than memory.
  
  The DaskInterface covers almost the complete API exposed
  by the PandasInterface with two notable exceptions:
  
  1) Sorting is not supported and any attempt at sorting will
     be ignored with an warning.
  2) Dask does not easily support adding a new column to an existing
     dataframe unless it is a scalar, add_dimension will therefore
     error when supplied a non-scalar value.
  4) Not all functions can be easily applied to a dask dataframe so
     some functions applied with aggregate and reduce will not work.
docstr: Given a Dataset object and a dictionary with dimension keys and
  selection keys (i.e. tuple ranges, slices, sets, lists. or literals)
  return a boolean mask over the rows in the Dataset object that
  have been selected.
docstr_tok: ["Given","a","Dataset","object","and","a","dictionary","with","dimension","keys","and","selection","keys","(","i.e",".","tuple","ranges",",","slices",",","sets",",","lists",".","or","literals",")","return","a","boolean","mask","over","the","rows","in","the","Dataset","object","that","have","been","selected","."]
code: def select_mask(cls, dataset, selection):
      """
      Given a Dataset object and a dictionary with dimension keys and
      selection keys (i.e. tuple ranges, slices, sets, lists. or literals)
      return a boolean mask over the rows in the Dataset object that
      have been selected.
      """
      select_mask = None
      for dim, k in selection.items():
          if isinstance(k, tuple):
              k = slice(*k)
          masks = []
          alias = dataset.get_dimension(dim).name
          series = dataset.data[alias]
          if isinstance(k, slice):
              if k.start is not None:
                  # Workaround for dask issue #3392
                  kval = util.numpy_scalar_to_python(k.start)
                  masks.append(kval <= series)
              if k.stop is not None:
                  kval = util.numpy_scalar_to_python(k.stop)
                  masks.append(series < kval)
          elif isinstance(k, (set, list)):
              iter_slc = None
              for ik in k:
                  mask = series == ik
                  if iter_slc is None:
                      iter_slc = mask
                  else:
                      iter_slc |= mask
              masks.append(iter_slc)
          elif callable(k):
              masks.append(k(series))
          else:
              masks.append(series == k)
          for mask in masks:
              if select_mask is not None:
                  select_mask &= mask
              else:
                  select_mask = mask
      return select_mask
  
imports: import sys
  import numpy
  import pandas
  from ..None import util
  from ..dimension import Dimension
  from ..element import Element
  from ..ndmapping import NdMapping, item_check, sorted_context
  from .interface import Interface
  from .pandas import PandasInterface
label_desc: Use image node_id 10 for calling the DaskInterface obj's underlying member method code with example usage: obj.select_mask(cls, dataset, selection) and returns: select_mask