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: Serialize the object.
  
  Returns
  -------
  obj : list
      A serialized version of the instance in the form of a list.
docstr_tok: ["Serialize","the","object",".","Returns","--","--","--","-","obj",":","list","A","serialized","version","of","the","instance","in","the","form","of","a","list","."]
code: def _serialize(self):
      """Serialize the object.
  
      Returns
      -------
      obj : list
          A serialized version of the instance in the form of a list.
      """
      result = list()
      for route in self._routes:
          result.append(
              {"callee": route.callee, "caller": route.caller}
          )
      return result
  
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 4 for calling the MethodMapping obj's underlying member method code with example usage: obj._serialize() and returns: result