ó
    tñ:iµ  ã                   ó\  • S r SSKrSSKrSSKJr  SSKJr  SSKJrJ	r	J
r
JrJrJr  SSKJr  SSKJrJrJrJr  SSSSSS	.S
\\   S\\   S\\   S\\   S\\   S\	\/\4   4S jjr\" SSS9S\SS4S j5       r\" SSS9S\
\\4   4S j5       r\\" SSSSS9S\S\S   4S j5       5       rg)z Global configuration for XGBoosté    N)Úcontextmanager)Úwraps)ÚAnyÚCallableÚDictÚIteratorÚOptionalÚcasté   )Ú_F)Ú_LIBÚ_check_callÚc_strÚpy_str)ÚheaderÚ
extra_noteÚ
parametersÚreturnsÚsee_alsor   r   r   r   r   Úreturnc           	      ó„   ^ ^^^^^^^• SmSmS[         [           S[        4S jmS[        S[        4UUUU UUUU4S jjnU$ )a  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
a  
    {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
    af  
    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
    Úvaluer   c                 ó   • U c  S$ U $ )NÚ © )r   s    ÚQ/srv/projetos/modelo_ml_acdoc/venv/lib/python3.13/site-packages/xgboost/config.pyÚnone_to_strÚconfig_doc.<locals>.none_to_str\   s   € Ø‘]ˆrÐ-¨Ð-ó    Úfuncc                 ó   >^ • TR                  T" T5      T" T5      S9T" T5      -   T" T5      -   T" T5      -   T" T	5      -   T l        [        T 5      S[        S[        S[        4U 4S jj5       n[	        [
        U5      $ )N)r   r   ÚargsÚkwargsr   c                  ó   >• T" U 0 UD6$ ©Nr   )r"   r#   r    s     €r   ÚwrapÚ6config_doc.<locals>.config_doc_decorator.<locals>.wrapj   s   ø€ á˜Ð( Ñ(Ð(r   )ÚformatÚ__doc__r   r   r
   r   )
r    r&   Úcommon_exampleÚdoc_templater   r   r   r   r   r   s
   ` €€€€€€€€r   Úconfig_doc_decoratorÚ(config_doc.<locals>.config_doc_decorator_   s£   ù€ à×ÑÙ" 6Ó*±{À:Ó7Nð  ð ñ ˜*Ó%ñ&ñ ˜'Ó"ñ	#ñ
 ˜.Ó)ñ*ñ ˜(Ó#ñ$ð 	Œô 
ˆt‹ð	)œð 	)¤sð 	)¬sö 	)ó 
ð	)ô ”B˜‹~Ðr   )r	   Ústrr   )	r   r   r   r   r   r,   r*   r+   r   s	   ````` @@@r   Ú
config_docr/      sI   ÿ€ ð0
€Lð)€NðV.œ8¤C™=ð .¬Sô .ð¤2ð ¬"÷ ö ð"  Ðr   z#
    Set global configuration.
    z‘
    Parameters
    ----------
    new_config: Dict[str, Any]
        Keyword arguments representing the parameters and their values
            )r   r   Ú
new_configc                  óÈ   • 0 nU R                  5        H  u  p#Uc  M
  X1U'   M     [        R                  " U5      n[        [        R
                  " [        U5      5      5        g r%   )ÚitemsÚjsonÚdumpsr   r   ÚXGBSetGlobalConfigr   )r0   Únot_noneÚkÚvÚconfigs        r   Ú
set_configr:   s   sQ   € ð €HØ× Ñ Ö"‰ˆØ‹=Ø�Q‹Kñ #ô �ZŠZ˜Ó!€FÜ”×'Ò'¬¨f«Ó6Õ7r   z9
    Get current values of the global configuration.
    zu
    Returns
    -------
    args: Dict[str, Any]
        The list of global parameters and their values
            )r   r   c                  óþ   • [         R                  " 5       n [        [        R                  " [         R
                  " U 5      5      5        U R                  nU(       d   e[        R                  " [        U5      5      nU$ r%   )
ÚctypesÚc_char_pr   r   ÚXGBGetGlobalConfigÚbyrefr   r3   Úloadsr   )Ú
config_strr   r9   s      r   Ú
get_configrB   ‡   sU   € ô —’Ó"€JÜ”×'Ò'¬¯ª°ZÓ(@ÓAÔBØ×Ñ€EÞ€Lˆ5Ü�ZŠZœ˜u›Ó&€FØ€Mr   z;
    Context manager for global XGBoost configuration.
    zÄ
    .. note::

        All settings, not just those presently modified, will be returned to their
        previous values when the context manager is exited. This is not thread-safe.
            z—
    See Also
    --------
    set_config: Set global XGBoost configuration
    get_config: Get current values of the global configuration
            )r   r   r   r   c               +   ó’   #   • [        5       R                  5       n[        S0 U D6   S v •  [        S0 UD6  g ! [        S0 UD6  f = f7f)Nr   )rB   Úcopyr:   )r0   Ú
old_configs     r   Úconfig_contextrF   ›   s@   é € ô2 “×"Ñ"Ó$€JÜÑ�Òð!ÛäÑ �ZÓ øŒ
Ñ �ZÓ üs   ‚$A§7 «A·AÁA)r)   r<   r3   Ú
contextlibr   Ú	functoolsr   Útypingr   r   r   r   r	   r
   Ú_typingr   Úcorer   r   r   r   r.   r/   r:   rB   rF   r   r   r   Ú<module>rL      sD  ðá &Û Û Ý %Ý ß @× @å ß 2Ó 2ð
 !Ø $Ø $Ø!Ø"òc à�S‰Mðc ð ˜‘ðc ð ˜‘ð	c ð
 �c‰]ðc ð �s‰mðc ð ˆrˆd�BˆhÑõc ñL ððñ	
ð8˜Sð 8 Tó 8ó
ð8ñ ððñ	
ð�D˜˜c˜‘Nó ó
ðð Ùððððñ!ð.! ð !¨°$©ó !ó/ó ñ0!r   