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: Adapter constructor.
  
  Note:
      You have to import the extractor 'E' from this module to construct
      adapters.
  
  Args:
      adapting_recipes: Recipes used to control the input translation.
          An adapting recipe may be any Python data structure. If this structure
          contains placeholders denoted by `E`, then values extracted from parent
          steps' outputs will be substituted in their place.
          `adapting_recipes` is a dict where the keys match the arguments
          expected by the transformer. The values in this dictionary may be for example
          one of the following:
  
          1. `E('input_name', 'key')` will query the parent step
              'input_name' for the output 'key'
  
          2. List of `E('input_name', 'key')` will apply the extractors
              to the parent steps and combine the results into a list
  
          3. Tuple of `E('input_name', 'key')` will apply the extractors
              to the parent steps and combine the results into a tuple
  
          4. Dict like `{k: E('input_name', 'key')}` will apply the
              extractors to the parent steps and combine the results
              into a dict with the same keys
  
          5. Anything else: the value itself will be used as the argument
              to the transformer
code: def __init__(self, adapting_recipes: Dict[str, AdaptingRecipe]):
      """Adapter constructor.
  
      Note:
          You have to import the extractor 'E' from this module to construct
          adapters.
  
      Args:
          adapting_recipes: Recipes used to control the input translation.
              An adapting recipe may be any Python data structure. If this structure
              contains placeholders denoted by `E`, then values extracted from parent
              steps' outputs will be substituted in their place.
              `adapting_recipes` is a dict where the keys match the arguments
              expected by the transformer. The values in this dictionary may be for example
              one of the following:
  
              1. `E('input_name', 'key')` will query the parent step
                  'input_name' for the output 'key'
  
              2. List of `E('input_name', 'key')` will apply the extractors
                  to the parent steps and combine the results into a list
  
              3. Tuple of `E('input_name', 'key')` will apply the extractors
                  to the parent steps and combine the results into a tuple
  
              4. Dict like `{k: E('input_name', 'key')}` will apply the
                  extractors to the parent steps and combine the results
                  into a dict with the same keys
  
              5. Anything else: the value itself will be used as the argument
                  to the transformer
      """
      self.adapting_recipes = adapting_recipes
  
file_path: steppy/steppy/adapter.py
imports: from typing import Tuple, List, Dict, Any, NamedTuple
label_desc: Use image node_id 1 to create a new Adapter object  with example: obj = Adapter(adapting_recipes)