class_docstr: Stores and handles metadata routing for a router object.
  
  This class is used by router objects to store and handle metadata routing.
  Routing information is stored as a dictionary of the form ``{"object_name":
  RouteMappingPair(method_mapping, routing_info)}``, where ``method_mapping``
  is an instance of :class:`~sklearn.utils.metadata_routing.MethodMapping` and
  ``routing_info`` is either a
  :class:`~sklearn.utils.metadata_routing.MetadataRequest` or a
  :class:`~sklearn.utils.metadata_routing.MetadataRouter` instance.
  
  .. versionadded:: 1.3
  
  Parameters
  ----------
  owner : str
      The name of the object to which these requests belong.
class_docstr_tok: ["Stores","and","handles","metadata","routing","for","a","router","object",".","This","class","is","used","by","router","objects","to","store","and","handle","metadata","routing",".","Routing","information","is","stored","as","a","dictionary","of","the","form","``","{","``","object_name","''",":","RouteMappingPair","(","method_mapping",",","routing_info",")","}","``",",","where","``","method_mapping","``","is","an","instance","of",":","class",":","`","~sklearn.utils.metadata_routing.MethodMapping","`","and","``","routing_info","``","is","either","a",":","class",":","`","~sklearn.utils.metadata_routing.MetadataRequest","`","or","a",":","class",":","`","~sklearn.utils.metadata_routing.MetadataRouter","`","instance",".","..","versionadded",":",":","1.3","Parameters","--","--","--","--","--","owner",":","str","The","name","of","the","object","to","which","these","requests","belong","."]
docstr: Serialize the object.
  
  Returns
  -------
  obj : dict
      A serialized version of the instance in the form of a dictionary.
docstr_tok: ["Serialize","the","object",".","Returns","--","--","--","-","obj",":","dict","A","serialized","version","of","the","instance","in","the","form","of","a","dictionary","."]
code: def _serialize(self):
      """Serialize the object.
  
      Returns
      -------
      obj : dict
          A serialized version of the instance in the form of a dictionary.
      """
      res = dict()
      if self._self_request:
          res["$self_request"] = self._self_request._serialize()
      for name, route_mapping in self._route_mappings.items():
          res[name] = dict()
          res[name]["mapping"] = route_mapping.mapping._serialize()
          res[name]["router"] = route_mapping.router._serialize()
  
      return res
  
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 9 for calling the MetadataRouter obj's underlying member method code with example usage: obj._serialize() and returns: res