parameters: (self, fn)
return_statement: return _SampledDataset(self, FilterSampler(fn, self))
docstring: Returns a new dataset with samples filtered by the
          filter function `fn`.
  
          Note that if the Dataset is the result of a lazily transformed one with
          transform(lazy=False), the filter is eagerly applied to the transformed
          samples without materializing the transformed result. That is, the
          transformation will be applied again whenever a sample is retrieved after
          filter().
  
          Parameters
          ----------
          fn : callable
              A filter function that takes a sample as input and
              returns a boolean. Samples that return False are discarded.
  
          Returns
          -------
          Dataset
              The filtered dataset.
docstring_summary: Returns a new dataset with samples filtered by the
          filter function `fn`.
docstring_tokens: Returns a new dataset with samples filtered by the filter function fn .
function: def filter(self, fn):
          """Returns a new dataset with samples filtered by the
          filter function `fn`.
  
          Note that if the Dataset is the result of a lazily transformed one with
          transform(lazy=False), the filter is eagerly applied to the transformed
          samples without materializing the transformed result. That is, the
          transformation will be applied again whenever a sample is retrieved after
          filter().
  
          Parameters
          ----------
          fn : callable
              A filter function that takes a sample as input and
              returns a boolean. Samples that return False are discarded.
  
          Returns
          -------
          Dataset
              The filtered dataset.
          """
          from . import FilterSampler
          return _SampledDataset(self, FilterSampler(fn, self))
function_tokens: def filter ( self , fn ) : from . import FilterSampler return _SampledDataset ( self , FilterSampler ( fn , self ) )