code: def process_routing(obj, method, other_params, **kwargs):
      """Validate and route input parameters.
  
      This function is used inside a router's method, e.g. :term:`fit`,
      to validate the metadata and handle the routing.
  
      Assuming this signature: ``fit(self, X, y, sample_weight=None, **fit_params)``,
      a call to this function would be:
      ``process_routing(self, fit_params, sample_weight=sample_weight)``.
  
      .. versionadded:: 1.3
  
      Parameters
      ----------
      obj : object
          An object implementing ``get_metadata_routing``. Typically a
          meta-estimator.
  
      method : str
          The name of the router's method in which this function is called.
  
      other_params : dict
          A dictionary of extra parameters passed to the router's method,
          e.g. ``**fit_params`` passed to a meta-estimator's :term:`fit`.
  
      **kwargs : dict
          Parameters explicitly accepted and included in the router's method
          signature.
  
      Returns
      -------
      routed_params : Bunch
          A :class:`~utils.Bunch` of the form ``{"object_name": {"method_name":
          {prop: value}}}`` which can be used to pass the required metadata to
          corresponding methods or corresponding child objects. The object names
          are those defined in `obj.get_metadata_routing()`.
      """
      if not hasattr(obj, "get_metadata_routing"):
          raise AttributeError(
              f"This {repr(obj.__class__.__name__)} has not implemented the routing"
              " method `get_metadata_routing`."
          )
      if method not in METHODS:
          raise TypeError(
              f"Can only route and process input on these methods: {METHODS}, "
              f"while the passed method is: {method}."
          )
  
      # We take the extra params (**fit_params) which is passed as `other_params`
      # and add the explicitly passed parameters (passed as **kwargs) to it. This
      # is equivalent to a code such as this in a router:
      # if sample_weight is not None:
      #     fit_params["sample_weight"] = sample_weight
      all_params = other_params if other_params is not None else dict()
      all_params.update(kwargs)
  
      request_routing = get_routing_for_object(obj)
      request_routing.validate_metadata(
          params=all_params, method=method
      )
      routed_params = request_routing.route_params(
          params=all_params, caller=method
      )
  
      return routed_params
  
imports: import inspect
  from collections import namedtuple
  from copy import deepcopy
  from typing import 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 5 for calling a global function with example usage: process_routing(obj, method, other_params) and returns: routed_params