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']))
code: def _construct_element(self, all_ouputs: AllOutputs, element: E):
      input_name = element.input_name
      key = element.key
      try:
          input_results = all_ouputs[input_name]
          try:
              return input_results[key]
          except KeyError:
              msg = "Input '{}' didn't have '{}' in its result.".format(
                  input_name, key
              )
              raise AdapterError(msg)
      except KeyError:
          msg = "No such input: '{}'".format(input_name)
          raise AdapterError(msg)
  
file_path: steppy/steppy/adapter.py
imports: from typing import Tuple, List, Dict, Any, NamedTuple
label_desc: Use image node_id 5 for calling the Adapter obj's underlying member method code with example usage: obj._construct_element(all_ouputs, element) and returns: input_results