class_docstr: Stores the mapping between callee and caller methods for a router.
  
  This class is primarily used in a ``get_metadata_routing()`` of a router
  object when defining the mapping between a sub-object (a sub-estimator or a
  scorer) to the router's methods. It stores a collection of ``Route``
  namedtuples.
  
  Iterating through an instance of this class will yield named
  ``MethodPair(callee, caller)`` tuples.
  
  .. versionadded:: 1.3
class_docstr_tok: ["Stores","the","mapping","between","callee","and","caller","methods","for","a","router",".","This","class","is","primarily","used","in","a","``","get_metadata_routing","(",")","``","of","a","router","object","when","defining","the","mapping","between","a","sub-object","(","a","sub-estimator","or","a","scorer",")","to","the","router","'s","methods",".","It","stores","a","collection","of","``","Route","``","namedtuples",".","Iterating","through","an","instance","of","this","class","will","yield","named","``","MethodPair","(","callee",",","caller",")","``","tuples",".","..","versionadded",":",":","1.3"]
docstr: Add a method mapping.
  
  Parameters
  ----------
  callee : str
      Child object's method name. This method is called in ``caller``.
  
  caller : str
      Parent estimator's method name in which the ``callee`` is called.
  
  Returns
  -------
  self : MethodMapping
      Returns self.
docstr_tok: ["Add","a","method","mapping",".","Parameters","--","--","--","--","--","callee",":","str","Child","object","'s","method","name",".","This","method","is","called","in","``","caller","``",".","caller",":","str","Parent","estimator","'s","method","name","in","which","the","``","callee","``","is","called",".","Returns","--","--","--","-","self",":","MethodMapping","Returns","self","."]
code: def add(self, *, callee, caller):
      """Add a method mapping.
  
      Parameters
      ----------
      callee : str
          Child object's method name. This method is called in ``caller``.
  
      caller : str
          Parent estimator's method name in which the ``callee`` is called.
  
      Returns
      -------
      self : MethodMapping
          Returns self.
      """
      if callee not in METHODS:
          raise ValueError(
              f"Given callee:{callee} is not a valid method. Valid methods are:"
              f" {METHODS}"
          )
      if caller not in METHODS:
          raise ValueError(
              f"Given caller:{caller} is not a valid method. Valid methods are:"
              f" {METHODS}"
          )
      self._routes.append(MethodPair(callee=callee, caller=caller))
      return self
  
imports: import inspect
  from collections import namedtuple
  from copy import deepcopy
  from typing import TYPE_CHECKING, Optional, Union
  from warnings import warn
  from ..None import get_config
  from ..exceptions import UnsetMetadataPassedError
  from ._bunch import Bunch
label_desc: Use image node_id 3 for calling the MethodMapping obj's underlying member method code with example usage: obj.add() and returns: self