def remove_handler(handler: logging.Handler) -> None:
    """removes given handler from the HuggingFace Transformers's root logger."""

    _configure_library_root_logger()

    assert handler is not None and handler not in _get_library_root_logger().handlers
    _get_library_root_logger().removeHandler(handler)
removes given handler from the HuggingFace Transformers's root logger.
dpkd/transformers/src/transformers/utils/logging.py