class_docstr: A very simple pipeline, assuming the last step is always a predictor.
class_docstr_tok: ["A","very","simple","pipeline",",","assuming","the","last","step","is","always","a","predictor","."]
code: def get_metadata_routing(self):
      router = MetadataRouter(owner=self.__class__.__name__)
      for i, step in enumerate(self.steps[:-1]):
          router.add(
              **{f"step_{i}": step},
              method_mapping=MethodMapping()
              .add(callee="fit", caller="fit")
              .add(callee="transform", caller="fit")
              .add(callee="transform", caller="predict"),
          )
      router.add(predictor=self.steps[-1], method_mapping="one-to-one")
      return router
  
imports: import re
  import numpy
  import pytest
  from sklearn import config_context
  from sklearn.base import BaseEstimator, clone
  from sklearn.linear_model import LinearRegression
  from sklearn.tests.metadata_routing_common import ConsumingClassifier, ConsumingRegressor, ConsumingTransformer, MetaRegressor, MetaTransformer, NonConsumingClassifier, WeightedMetaClassifier, WeightedMetaRegressor, _Registry, assert_request_equal, assert_request_is_empty, check_recorded_metadata
  from sklearn.utils import metadata_routing
  from sklearn.utils._metadata_requests import COMPOSITE_METHODS, METHODS, SIMPLE_METHODS, MethodMetadataRequest, MethodPair, _MetadataRequester, request_is_alias, request_is_valid
  from sklearn.utils.metadata_routing import MetadataRequest, MetadataRouter, MethodMapping, get_routing_for_object, process_routing
  from sklearn.utils.validation import check_is_fitted
label_desc: Use image node_id 4 for calling the SimplePipeline obj's underlying member method code with example usage: obj.get_metadata_routing() and returns: router