
    -iz:                     t   S r SSKrSSKrSSKJr  \" \R                  R                  SS5      5      \" \R                  R                  SS5      5      SS	\" \R                  R                  S
S5      5      SSSSSS.
r	\R                  " 5       rS rS r          SS jr\SSSSSSSSSSS.
S j5       rg)z7Global configuration state and functions for management    N)contextmanagerSKLEARN_ASSUME_FINITEFSKLEARN_WORKING_MEMORYi   Tdiagram SKLEARN_PAIRWISE_DIST_CHUNK_SIZE   default
assume_finiteworking_memoryprint_changed_onlydisplaypairwise_dist_chunk_sizeenable_cython_pairwise_distarray_api_dispatchtransform_outputenable_metadata_routingskip_parameter_validationc                      [        [        S5      (       d  [        R                  5       [        l        [        R                  $ )zxGet a threadlocal **mutable** configuration. If the configuration
does not exist, copy the default global configuration.global_config)hasattr_threadlocal_global_configcopyr        B/var/www/html/venv/lib/python3.13/site-packages/sklearn/_config.py_get_threadlocal_configr      s.     <11%3%8%8%:"%%%r   c                  2    [        5       R                  5       $ )a1  Retrieve the current scikit-learn configuration.

This reflects the effective global configurations as established by default upon
library import, or modified via :func:`set_config` or :func:`config_context`.

Returns
-------
config : dict
    Keys are parameter names that can be passed to :func:`set_config`.

See Also
--------
config_context : Context manager for global scikit-learn configuration.
set_config : Set global scikit-learn configuration.

Examples
--------
>>> import sklearn
>>> config = sklearn.get_config()
>>> config.keys()
dict_keys([...])
)r   r   r   r   r   
get_configr    #   s    2 #$))++r   c
                     [        5       n
U b  X
S'   Ub  XS'   Ub  X*S'   Ub  X:S'   Ub  XJS'   Ub  XZS'   Ub  SS	KJn  U" U5        XjS
'   Ub  XzS'   Ub  XS'   U	b  XS'   gg)a/  Set global scikit-learn configuration.

These settings control the behaviour of scikit-learn functions during a library
usage session. Global configuration defaults (as described in the parameter list
below) take effect when scikit-learn is imported.

This function can be used to modify the global scikit-learn configuration at
runtime. Passing `None` as an argument (the default) leaves the corresponding
setting unchanged. This allows users to selectively update the global configuration
values without affecting the others.

.. versionadded:: 0.19

Parameters
----------
assume_finite : bool, default=None
    If True, validation for finiteness will be skipped,
    saving time, but leading to potential crashes. If
    False, validation for finiteness will be performed,
    avoiding error. Global default: False.

    .. versionadded:: 0.19

working_memory : int, default=None
    If set, scikit-learn will attempt to limit the size of temporary arrays
    to this number of MiB (per job when parallelised), often saving both
    computation time and memory on expensive operations that can be
    performed in chunks. Global default: 1024.

    .. versionadded:: 0.20

print_changed_only : bool, default=None
    If True, only the parameters that were set to non-default
    values will be printed when printing an estimator. For example,
    ``print(SVC())`` while True will only print 'SVC()' while the default
    behaviour would be to print 'SVC(C=1.0, cache_size=200, ...)' with
    all the non-changed parameters. Global default: True.

    .. versionadded:: 0.21
    .. versionchanged:: 0.23
       Global default configuration changed from False to True.

display : {'text', 'diagram'}, default=None
    If 'diagram', estimators will be displayed as a diagram in a Jupyter
    lab or notebook context. If 'text', estimators will be displayed as
    text. Global default: 'diagram'.

    .. versionadded:: 0.23

pairwise_dist_chunk_size : int, default=None
    The number of row vectors per chunk for the accelerated pairwise-
    distances reduction backend. Global default: 256 (suitable for most of
    modern laptops' caches and architectures).

    Intended for easier benchmarking and testing of scikit-learn internals.
    End users are not expected to benefit from customizing this configuration
    setting.

    .. versionadded:: 1.1

enable_cython_pairwise_dist : bool, default=None
    Use the accelerated pairwise-distances reduction backend when
    possible. Global default: True.

    Intended for easier benchmarking and testing of scikit-learn internals.
    End users are not expected to benefit from customizing this configuration
    setting.

    .. versionadded:: 1.1

array_api_dispatch : bool, default=None
    Use Array API dispatching when inputs follow the Array API standard.
    Global default: False.

    See the :ref:`User Guide <array_api>` for more details.

    .. versionadded:: 1.2

transform_output : str, default=None
    Configure output of `transform` and `fit_transform`.

    See :ref:`sphx_glr_auto_examples_miscellaneous_plot_set_output.py`
    for an example on how to use the API.

    - `"default"`: Default output format of a transformer
    - `"pandas"`: DataFrame output
    - `"polars"`: Polars output
    - `None`: Transform configuration is unchanged

    Global default: "default".

    .. versionadded:: 1.2
    .. versionadded:: 1.4
        `"polars"` option was added.

enable_metadata_routing : bool, default=None
    Enable metadata routing. By default this feature is disabled.

    Refer to :ref:`metadata routing user guide <metadata_routing>` for more
    details.

    - `True`: Metadata routing is enabled
    - `False`: Metadata routing is disabled, use the old syntax.
    - `None`: Configuration is unchanged

    Global default: False.

    .. versionadded:: 1.3

skip_parameter_validation : bool, default=None
    If `True`, disable the validation of the hyper-parameters' types and values in
    the fit method of estimators and for arguments passed to public helper
    functions. It can save time in some situations but can lead to low level
    crashes and exceptions with confusing error messages.
    Global default: False.

    Note that for data parameters, such as `X` and `y`, only type validation is
    skipped but validation with `check_array` will continue to run.

    .. versionadded:: 1.3

See Also
--------
config_context : Context manager for global scikit-learn configuration.
get_config : Retrieve current values of the global configuration.

Examples
--------
>>> from sklearn import set_config
>>> set_config(display='diagram')  # doctest: +SKIP
Nr   r   r   r   r   r      )_check_array_api_dispatchr   r   r   r   )r   utils._array_apir#   )r   r   r   r   r   r   r   r   r   r   local_configr#   s               r   
set_configr&   ?   s    ^ +,L (5_%!)7%&%-?)*")Y+3K/0".6Q23%?!"45-?)*#+;'(*2I./ ,4M01 -r   c        
      #      #    [        5       n
[        U UUUUUUUUU	S9
   Sv   [        S0 U
D6  g! [        S0 U
D6  f = f7f)a  Context manager to temporarily change the global scikit-learn configuration.

This context manager can be used to apply scikit-learn configuration changes within
the scope of the with statement. Once the context exits, the global configuration is
restored again.

The default global configurations (which take effect when scikit-learn is imported)
are defined below in the parameter list.

Parameters
----------
assume_finite : bool, default=None
    If True, validation for finiteness will be skipped,
    saving time, but leading to potential crashes. If
    False, validation for finiteness will be performed,
    avoiding error. If None, the existing configuration won't change.
    Global default: False.

working_memory : int, default=None
    If set, scikit-learn will attempt to limit the size of temporary arrays
    to this number of MiB (per job when parallelised), often saving both
    computation time and memory on expensive operations that can be
    performed in chunks. If None, the existing configuration won't change.
    Global default: 1024.

print_changed_only : bool, default=None
    If True, only the parameters that were set to non-default
    values will be printed when printing an estimator. For example,
    ``print(SVC())`` while True will only print 'SVC()', but would print
    'SVC(C=1.0, cache_size=200, ...)' with all the non-changed parameters
    when False. If None, the existing configuration won't change.
    Global default: True.

    .. versionchanged:: 0.23
       Global default configuration changed from False to True.

display : {'text', 'diagram'}, default=None
    If 'diagram', estimators will be displayed as a diagram in a Jupyter
    lab or notebook context. If 'text', estimators will be displayed as
    text. If None, the existing configuration won't change.
    Global default: 'diagram'.

    .. versionadded:: 0.23

pairwise_dist_chunk_size : int, default=None
    The number of row vectors per chunk for the accelerated pairwise-
    distances reduction backend. Global default: 256 (suitable for most of
    modern laptops' caches and architectures).

    Intended for easier benchmarking and testing of scikit-learn internals.
    End users are not expected to benefit from customizing this configuration
    setting.

    .. versionadded:: 1.1

enable_cython_pairwise_dist : bool, default=None
    Use the accelerated pairwise-distances reduction backend when
    possible. Global default: True.

    Intended for easier benchmarking and testing of scikit-learn internals.
    End users are not expected to benefit from customizing this configuration
    setting.

    .. versionadded:: 1.1

array_api_dispatch : bool, default=None
    Use Array API dispatching when inputs follow the Array API standard.
    Global default: False.

    See the :ref:`User Guide <array_api>` for more details.

    .. versionadded:: 1.2

transform_output : str, default=None
    Configure output of `transform` and `fit_transform`.

    See :ref:`sphx_glr_auto_examples_miscellaneous_plot_set_output.py`
    for an example on how to use the API.

    - `"default"`: Default output format of a transformer
    - `"pandas"`: DataFrame output
    - `"polars"`: Polars output
    - `None`: Transform configuration is unchanged

    Global default: "default".

    .. versionadded:: 1.2
    .. versionadded:: 1.4
        `"polars"` option was added.

enable_metadata_routing : bool, default=None
    Enable metadata routing. By default this feature is disabled.

    Refer to :ref:`metadata routing user guide <metadata_routing>` for more
    details.

    - `True`: Metadata routing is enabled
    - `False`: Metadata routing is disabled, use the old syntax.
    - `None`: Configuration is unchanged

    Global default: False.

    .. versionadded:: 1.3

skip_parameter_validation : bool, default=None
    If `True`, disable the validation of the hyper-parameters' types and values in
    the fit method of estimators and for arguments passed to public helper
    functions. It can save time in some situations but can lead to low level
    crashes and exceptions with confusing error messages.
    Global default: False.

    Note that for data parameters, such as `X` and `y`, only type validation is
    skipped but validation with `check_array` will continue to run.

    .. versionadded:: 1.3

Yields
------
None.

See Also
--------
set_config : Set global scikit-learn configuration.
get_config : Retrieve current values of the global configuration.

Notes
-----
All settings, not just those presently modified, will be returned to
their previous values when the context manager is exited.

Examples
--------
>>> import sklearn
>>> from sklearn.utils.validation import assert_all_finite
>>> with sklearn.config_context(assume_finite=True):
...     assert_all_finite([float('nan')])
>>> with sklearn.config_context(assume_finite=True):
...     with sklearn.config_context(assume_finite=False):
...         assert_all_finite([float('nan')])
Traceback (most recent call last):
...
ValueError: Input contains NaN...
r
   Nr   )r    r&   )r   r   r   r   r   r   r   r   r   r   
old_configs              r   config_contextr)      sS     z J#%-!9$?-) 7";! Z 
 Z s   A 0 A =A )
NNNNNNNNNN)__doc__os	threading
contextlibr   boolenvirongetintr   localr   r   r    r&   r)   r   r   r   <module>r3      s    =
 
  7 "**..)@%HI"**..)A4HI #


93?! $(!$!&  &,: ! $ "gNT  ! $ "m! m!r   