code: def find_handler(logger, match_handler):
      
      for logger in walk_propagation_tree(logger):
          for handler in getattr(logger, 'handlers', []):
              if match_handler(handler):
                  return handler, logger
      return None, None
docs: Find a (specific type of) handler in the propagation tree of a logger.
  
      :param logger: The logger to check (a :class:`~logging.Logger` object).
      :param match_handler: A callable that receives a :class:`~logging.Handler`
                            object and returns :data:`True` to match a handler or
                            :data:`False` to skip that handler and continue
                            searching for a match.
      :returns: A tuple of two values:
  
                1. The matched :class:`~logging.Handler` object or :data:`None`
                   if no handler was matched.
                2. The :class:`~logging.Logger` object to which the handler is
                   attached or :data:`None` if no handler was matched.
  
      This function finds a logging handler (of the given type) attached to a
      logger or one of its parents (see :func:`walk_propagation_tree()`). It uses
      the undocumented :class:`~logging.Logger.handlers` attribute to find
      handlers attached to a logger, however it won't raise an exception if the
      attribute isn't available. The advantages of this approach are:
  
      - This works regardless of whether :mod:`coloredlogs` attached the handler
        or other Python code attached the handler.
  
      - This will correctly recognize the situation where the given logger has no
        handlers but :attr:`~logging.Logger.propagate` is enabled and the logger
        has a parent logger that does have a handler attached.