class_docstr: Organises data transformations into a pipeline.
  
  Example
  -------
  >>> pipeline = DataPipeline(
  ...     static_data_keys=["text"],
  ...     dynamic_items=[
  ...     {"func": lambda x: x.lower(), "takes": "text", "provides": "foo"},
  ...     {"func": lambda x: x[::-1], "takes": "foo", "provides": "bar"},
  ...     ],
  ...     output_keys=["bar"],
  ... )
  >>> pipeline({"text": "Test"})
  {'bar': 'tset'}
class_docstr_tok: ["Organises","data","transformations","into","a","pipeline",".","Example","--","--","--","-",">",">",">","pipeline","=","DataPipeline","(","...","static_data_keys=","[","``","text","''","]",",","...","dynamic_items=","[","...","{","``","func","''",":","lambda","x",":","x.lower","(",")",",","``","takes","''",":","``","text","''",",","``","provides","''",":","``","foo","''","}",",","...","{","``","func","''",":","lambda","x",":","x","[",":",":-1","]",",","``","takes","''",":","``","foo","''",",","``","provides","''",":","``","bar","''","}",",","...","]",",","...","output_keys=","[","``","bar","''","]",",","...",")",">",">",">","pipeline","(","{","``","text","''",":","``","Test","''","}",")","{","'bar","'",":","'tset","'","}"]
code: def _compute(self, data, order, output_mapping):
      if self.unaccounted_keys:
          MSG = "These keys are still unaccounted for in the data pipeline: "
          MSG += ", ".join(self.unaccounted_keys)
          raise RuntimeError(MSG)
      intermediate = {}
      for node_id, edges, item in order:
          if isinstance(item, StaticItem):
              # Static item in data.
              # Just check that key is found.
              try:
                  data[item.key]
                  continue
              except KeyError:
                  raise KeyError(f"Expected key {item.key} in data!")
          # A dynamic item, which we should compute:
          args = [
              data[argkey] if argkey in data else intermediate[argkey]
              for argkey in item.next_takes()
          ]
          # This needs to be called BEFORE the dynamic item is called.
          provided_keys = item.next_provides()
          values = item(*args)  # Call the DynamicItem to produce output
          # If there is just one output value, wrap in a list so that
          # it can be zipped as well:
          if len(provided_keys) == 1:
              values = [values]
          intermediate.update(zip(provided_keys, values))
      for dynamic_item in self.dynamic_items:
          dynamic_item.reset()
      return {
          outkey: data[inkey] if inkey in data else intermediate[inkey]
          for outkey, inkey in output_mapping.items()
      }
  
imports: import inspect
  from dataclasses import dataclass
  from speechbrain.utils.depgraph import DependencyGraph
label_desc: Use image node_id 10 for calling the DataPipeline obj's underlying member method code with example usage: obj._compute(data, order, output_mapping) and returns: unknown