class_docstr: Translates outputs from parent steps to inputs to the current step.
  
  Attributes:
      adapting_recipes: The recipes that the adapter was initialized with.
  
  Example:
      Normally Adapter is used with a Step. In the following example
      `RandomForestTransformer` follows sklearn convention of calling arguments `X` and `y`,
      however names passed to the Step are different. We use Adapter to map recieved names
      to the expected names.
  
      .. code-block:: python
  
          from sklearn.datasets import load_iris
          from sklearn.ensemble import RandomForestClassifier
          from sklearn.metrics import log_loss
          from steppy.base import BaseTransformer, Step
          from steppy.adapter import Adapter, E
  
          iris = load_iris()
  
          pipeline_input = {
              'train_data': {
                  'target': iris.target,
                  'data': iris.data
              }
          }
  
          class RandomForestTransformer(BaseTransformer):
              def __init__(self, random_state=None):
                  self.estimator = RandomForestClassifier(random_state=random_state)
  
              def fit(self, X, y):
                  self.estimator.fit(X, y)
                  return self
  
              def transform(self, X, **kwargs):
                  y_proba  = self.estimator.predict_proba(X)
                  return {'y_proba': y_proba}
  
          random_forest = Step(
              name="random_forest",
              transformer=RandomForestTransformer(),
              input_data=['train_data'],
              adapter=Adapter({
                  'X': E('train_data', 'data'),
                  'y': E('train_data', 'target')
              }),
              experiment_directory='./working_dir'
          )
  
          result = random_forest.fit_transform(pipeline_input)
          print(log_loss(y_true=iris.target, y_pred=result['y_proba']))
docstr: Adapt inputs for the transformer included in the step.
  
  Args:
      all_ouputs: Dict of outputs from parent steps. The keys should
          match the names of these steps and the values should be their
          respective outputs.
  
  Returns:
      Dictionary with the same keys as `adapting_recipes` and values
      constructed according to the respective recipes.
code: def adapt(self, all_ouputs: AllOutputs) -> DataPacket:
      """Adapt inputs for the transformer included in the step.
  
      Args:
          all_ouputs: Dict of outputs from parent steps. The keys should
              match the names of these steps and the values should be their
              respective outputs.
  
      Returns:
          Dictionary with the same keys as `adapting_recipes` and values
          constructed according to the respective recipes.
  
      """
      adapted = {}
      for name, recipe in self.adapting_recipes.items():
          adapted[name] = self._construct(all_ouputs, recipe)
      return adapted
  
file_path: steppy/steppy/adapter.py
imports: from typing import Tuple, List, Dict, Any, NamedTuple
label_desc: Use image node_id 2 for calling the Adapter obj's underlying member method code with example usage: obj.adapt(all_ouputs) and returns: adapted