class_docstr: Dataset that reads, wrangles, and produces dicts.
  
  Each data point dict provides some items (by key), for example, a path to a
  wavefile with the key "wav_file". When a data point is fetched from this
  Dataset, more items are produced dynamically, based on pre-existing items
  and other dynamic created items. For example, a dynamic item could take the
  wavfile path and load the audio from the disk.
  
  The dynamic items can depend on other dynamic items: a suitable evaluation
  order is used automatically,  as long as there are no circular dependencies.
  
  A specified list of keys is collected in the output dict. These can be items
  in the original data or dynamic items. If some dynamic items are not
  requested, nor depended on by other requested items, they won't be computed.
  So for example if a user simply wants to iterate over the text, the
  time-consuming audio loading can be skipped.
  
  About the format:
  Takes a dict of dicts as the collection of data points to read/wrangle.
  The top level keys are data point IDs.
  Each data point (example) dict should have the same keys, corresponding to
  different items in that data point.
  
  Altogether the data collection could look like this:
  
  >>> data = {
  ...  "spk1utt1": {
  ...      "wav_file": "/path/to/spk1utt1.wav",
  ...      "text": "hello world",
  ...      "speaker": "spk1",
  ...      },
  ...  "spk1utt2": {
  ...      "wav_file": "/path/to/spk1utt2.wav",
  ...      "text": "how are you world",
  ...      "speaker": "spk1",
  ...      }
  ... }
  
  NOTE
  ----
      The top-level key, the data point id, is implicitly added as an item
      in the data point, with the key "id"
  
  Each dynamic item is configured by three things: a key, a func, and a list
  of argkeys. The key should be unique among all the items (dynamic or not) in
  each data point. The func is any callable, and it returns the dynamic item's
  value. The callable is called with the values of other items as specified
  by the argkeys list (as positional args, passed in the order specified by
  argkeys).
  
  The dynamic_items configuration could look like this:
  
  >>> import torch
  >>> dynamic_items = [
  ...     {"func": lambda l: torch.Tensor(l),
  ...     "takes": ["wav_loaded"],
  ...     "provides": "wav"},
  ...     {"func": lambda path: [ord(c)/100 for c in path],  # Fake "loading"
  ...     "takes": ["wav_file"],
  ...     "provides": "wav_loaded"},
  ...     {"func": lambda t: t.split(),
  ...     "takes": ["text"],
  ...     "provides": "words"}]
  
  With these, different views of the data can be loaded:
  
  >>> from speechbrain.dataio.dataloader import SaveableDataLoader
  >>> from speechbrain.dataio.batch import PaddedBatch
  >>> dataset = DynamicItemDataset(data, dynamic_items)
  >>> dataloader = SaveableDataLoader(dataset, collate_fn=PaddedBatch,
  ...     batch_size=2)
  >>> # First, create encoding for words:
  >>> dataset.set_output_keys(["words"])
  >>> encoding = {}
  >>> next_id = 1
  >>> for batch in dataloader:
  ...     for sent in batch.words:
  ...         for word in sent:
  ...             if word not in encoding:
  ...                 encoding[word] = next_id
  ...                 next_id += 1
  >>> # Next, add an encoded words_tensor dynamic item:
  >>> dataset.add_dynamic_item(
  ...     func = lambda ws: torch.tensor([encoding[w] for w in ws],
  ...             dtype=torch.long),
  ...     takes = ["words"],
  ...     provides = "words_encoded")
  >>> # Now we can get word and audio tensors:
  >>> dataset.set_output_keys(["id", "wav", "words_encoded"])
  >>> batch = next(iter(dataloader))
  >>> batch.id
  ['spk1utt1', 'spk1utt2']
  >>> batch.wav  # +ELLIPSIS
  PaddedData(data=tensor([[0.4700, 1.1200, ...
  >>> batch.words_encoded
  PaddedData(data=tensor([[1, 2, 0, 0],
          [3, 4, 5, 2]]), lengths=tensor([0.5000, 1.0000]))
  
  Output keys can also be a map:
  
  >>> dataset.set_output_keys({"id":"id", "signal": "wav", "words": "words_encoded"})
  >>> batch = next(iter(dataloader))
  >>> batch.words
  PaddedData(data=tensor([[1, 2, 0, 0],
          [3, 4, 5, 2]]), lengths=tensor([0.5000, 1.0000]))
  
  
  Arguments
  ---------
  data : dict
      Dictionary containing single data points (e.g. utterances).
  dynamic_items : list, optional
      Configuration for the dynamic items produced when fetching an example.
      List of DynamicItems or dicts with the format::
          func: <callable> # To be called
          takes: <list> # key or list of keys of args this takes
          provides: key # key or list of keys that this provides
  output_keys : dict, list, optional
      List of keys (either directly available in data or dynamic items)
      to include in the output dict when data points are fetched.
  
      If a dict is given; it is used to map internal keys to output keys.
      From the output_keys dict key:value pairs the key appears outside,
      and value is the internal key.
docstr: Get a filtered and/or sorted version of this, shares static data.
  
  The reason to implement these operations in the same method is that
  computing some dynamic items may be expensive, and this way the
  filtering and sorting steps don't need to compute the dynamic items
  twice.
  
  Arguments
  ---------
  key_min_value : dict
      Map from key (in data or in dynamic items) to limit, will only keep
      data_point if data_point[key] >= limit
  key_max_value : dict
      Map from key (in data or in dynamic items) to limit, will only keep
      data_point if data_point[key] <= limit
  key_test : dict
      Map from key (in data or in dynamic items) to func, will only keep
      data_point if bool(func(data_point[key])) == True
  sort_key : None, str
      If not None, sort by data_point[sort_key]. Default is ascending
      order.
  reverse : bool
      If True, sort in descending order.
  select_n : None, int
      If not None, only keep (at most) the first n filtered data_points.
      The possible sorting is applied, but only on the first n data
      points found. Meant for debugging.
  
  Returns
  -------
  FilteredSortedDynamicItemDataset
      Shares the static data, but has its own output keys and
      dynamic items (initially deep copied from this, so they have the
      same dynamic items available)
  
  NOTE
  ----
  Temporarily changes the output keys!
docstr_tok: ["Get","a","filtered","and\/or","sorted","version","of","this",",","shares","static","data",".","The","reason","to","implement","these","operations","in","the","same","method","is","that","computing","some","dynamic","items","may","be","expensive",",","and","this","way","the","filtering","and","sorting","steps","do","n't","need","to","compute","the","dynamic","items","twice",".","Arguments","--","--","--","--","-","key_min_value",":","dict","Map","from","key","(","in","data","or","in","dynamic","items",")","to","limit",",","will","only","keep","data_point","if","data_point","[","key","]",">","=","limit","key_max_value",":","dict","Map","from","key","(","in","data","or","in","dynamic","items",")","to","limit",",","will","only","keep","data_point","if","data_point","[","key","]","<","=","limit","key_test",":","dict","Map","from","key","(","in","data","or","in","dynamic","items",")","to","func",",","will","only","keep","data_point","if","bool","(","func","(","data_point","[","key","]",")",")","==","True","sort_key",":","None",",","str","If","not","None",",","sort","by","data_point","[","sort_key","]",".","Default","is","ascending","order",".","reverse",":","bool","If","True",",","sort","in","descending","order",".","select_n",":","None",",","int","If","not","None",",","only","keep","(","at","most",")","the","first","n","filtered","data_points",".","The","possible","sorting","is","applied",",","but","only","on","the","first","n","data","points","found",".","Meant","for","debugging",".","Returns","--","--","--","-","FilteredSortedDynamicItemDataset","Shares","the","static","data",",","but","has","its","own","output","keys","and","dynamic","items","(","initially","deep","copied","from","this",",","so","they","have","the","same","dynamic","items","available",")","NOTE","--","--","Temporarily","changes","the","output","keys","!"]
code: def filtered_sorted(
      self,
      key_min_value={},
      key_max_value={},
      key_test={},
      sort_key=None,
      reverse=False,
      select_n=None,
  ):
      """Get a filtered and/or sorted version of this, shares static data.
  
      The reason to implement these operations in the same method is that
      computing some dynamic items may be expensive, and this way the
      filtering and sorting steps don't need to compute the dynamic items
      twice.
  
      Arguments
      ---------
      key_min_value : dict
          Map from key (in data or in dynamic items) to limit, will only keep
          data_point if data_point[key] >= limit
      key_max_value : dict
          Map from key (in data or in dynamic items) to limit, will only keep
          data_point if data_point[key] <= limit
      key_test : dict
          Map from key (in data or in dynamic items) to func, will only keep
          data_point if bool(func(data_point[key])) == True
      sort_key : None, str
          If not None, sort by data_point[sort_key]. Default is ascending
          order.
      reverse : bool
          If True, sort in descending order.
      select_n : None, int
          If not None, only keep (at most) the first n filtered data_points.
          The possible sorting is applied, but only on the first n data
          points found. Meant for debugging.
  
      Returns
      -------
      FilteredSortedDynamicItemDataset
          Shares the static data, but has its own output keys and
          dynamic items (initially deep copied from this, so they have the
          same dynamic items available)
  
      NOTE
      ----
      Temporarily changes the output keys!
      """
      filtered_sorted_ids = self._filtered_sorted_ids(
          key_min_value,
          key_max_value,
          key_test,
          sort_key,
          reverse,
          select_n,
      )
      return FilteredSortedDynamicItemDataset(self, filtered_sorted_ids)
  
imports: import copy
  import contextlib
  from types import MethodType
  from torch.utils.data import Dataset
  from speechbrain.utils.data_pipeline import DataPipeline
  from speechbrain.dataio.dataio import load_data_json, load_data_csv
  from speechbrain.utils.data_utils import batch_shuffle
  import logging
  import math
label_desc: Use image node_id 7 for calling the DynamicItemDataset obj's underlying member method code with example usage: obj.filtered_sorted(key_min_value, key_max_value, key_test, sort_key, reverse, select_n) and returns: FilteredSortedDynamicItemDataset