def METHOD_NAME(
    *,
    header: Optional[str] = None,
    extra_note: Optional[str] = None,
    parameters: Optional[str] = None,
    returns: Optional[str] = None,
    see_also: Optional[str] = None,
) -> Callable[[_F], _F]:
    """Decorator to format docstring for config functions.
    Parameters
    ----------
    header: str
        An introducion to the function
    extra_note: str
        Additional notes
    parameters: str
        Parameters of the function
    returns: str
        Return value
    see_also: str
        Related functions
    """
    doc_template = """
    {header}
    Global configuration consists of a collection of parameters that can be applied in the
    global scope. See :ref:`global_config` for the full list of parameters supported in
    the global configuration.
    {extra_note}
    .. versionadded:: 1.4.0
    """
    common_example = """
    Example
    -------
    .. code-block:: python
        import xgboost as xgb
        # Show all messages, including ones pertaining to debugging
        xgb.set_config(verbosity=2)
        # Get current value of global configuration
        # This is a dict containing all parameters in the global configuration,
        # including 'verbosity'
        config = xgb.get_config()
        assert config['verbosity'] == 2
        # Example of using the context manager xgb.config_context().
        # The context manager will restore the previous value of the global
        # configuration upon exiting.
        with xgb.config_context(verbosity=0):
            # Suppress warning caused by model generated with XGBoost version < 1.0.0
            bst = xgb.Booster(model_file='./old_model.bin')
        assert xgb.get_config()['verbosity'] == 2  # old value restored
    Nested configuration context is also supported:
    Example
    -------
    .. code-block:: python
        with xgb.config_context(verbosity=3):
            assert xgb.get_config()["verbosity"] == 3
            with xgb.config_context(verbosity=2):
                assert xgb.get_config()["verbosity"] == 2
        xgb.set_config(verbosity=2)
        assert xgb.get_config()["verbosity"] == 2
        with xgb.config_context(verbosity=3):
            assert xgb.get_config()["verbosity"] == 3
    """
    def none_to_str(value: Optional[str]) -> str:
        return "" if value is None else value
    def config_doc_decorator(func: _F) -> _F:
        func.__doc__ = (
            doc_template.format(
                header=none_to_str(header), extra_note=none_to_str(extra_note)
            )
            + none_to_str(parameters)
            + none_to_str(returns)
            + none_to_str(common_example)
            + none_to_str(see_also)
        )
        @wraps(func)
        def wrap(*args: Any, **kwargs: Any) -> Any:
            return func(*args, **kwargs)
        return cast(_F, wrap)
    return config_doc_decorator