§
    ªöÉgnc  ã                  óN  — U d Z ddlmZ ddlmZmZ ddlZddlmZm	Z	m
Z
mZmZmZ ddlZddlmZmZ ddlmZ erddlmZmZ  G d	„ d
e¦  «        Z G d„ de¦  «        Zi Zded<   i Zded<   i Zded<   dgZded<    G d„ dee¦  «        Z d^d„Z!d_d`d „Z"dad"„Z#dbdcd'„Z$d_ddd(„Z%ded)„Z& G d*„ d+¦  «        Z' G d,„ d-ee         ¦  «        Z(d.Z)d/Z*d0Z+d1Z, e(e"e)¦  «        a- e(e#e*¦  «        a. e(e%e,¦  «        Z/ e(e$e+¦  «        Z0 e'e¦  «        Z1 G d2„ d3e¦  «        Z2	 	 	 dfdgd<„a3	 	 	 dhdid@„Z4djdA„Z5dkdC„Z6dldD„Z7dmdE„Z8dmdF„Z9dndG„Z:dldH„Z;dodJ„Z<dpdqdQ„Z=edrdT„¦   «         Z>dsdX„Z?dtdY„Z@dtdZ„ZAdud\„ZB e?eC¦  «        ZD e?eE¦  «        ZF e?eG¦  «        ZH e?eI¦  «        ZJ e@eIeKf¦  «        ZLdvd]„ZMdS )waò  
The config module holds package-wide configurables and provides
a uniform API for working with them.

Overview
========

This module supports the following requirements:
- options are referenced using keys in dot.notation, e.g. "x.y.option - z".
- keys are case-insensitive.
- functions should accept partial/regex keys, when unambiguous.
- options can be registered by modules at import time.
- options can be registered at init-time (via core.config_init)
- options have a default value, and (optionally) a description and
  validation function associated with them.
- options can be deprecated, in which case referencing them
  should produce a warning.
- deprecated options can optionally be rerouted to a replacement
  so that accessing a deprecated option reroutes to a differently
  named option.
- options can be reset to their default value.
- all option can be reset to their default value at once.
- all options in a certain sub - namespace can be reset at once.
- the user can set / get / reset or ask for the description of an option.
- a developer can register and mark an option as deprecated.
- you can register a callback to be invoked when the option value
  is set or reset. Changing the stored value is considered misuse, but
  is not verboten.

Implementation
==============

- Data is stored using nested dictionaries, and should be accessed
  through the provided API.

- "Registered options" and "Deprecated options" have metadata associated
  with them, which are stored in auxiliary dictionaries keyed on the
  fully-qualified key, e.g. "x.y.z.option".

- the config_init module is imported by the package's __init__.py file.
  placing any register_option() calls there will ensure those options
  are available as soon as pandas is loaded. If you use register_option
  in a module, it will only be available after that module is imported,
  which you should be aware of.

- `config_prefix` is a context_manager (for use with the `with` keyword)
  which can save developers some typing, see the docstring.

é    )Úannotations)ÚContextDecoratorÚcontextmanagerN)ÚTYPE_CHECKINGÚAnyÚCallableÚGenericÚ
NamedTupleÚcast)ÚFÚT)Úfind_stack_level)Ú	GeneratorÚIterablec                  ó8   — e Zd ZU ded<   ded<   ded<   ded<   dS )ÚDeprecatedOptionÚstrÚkeyú
str | NoneÚmsgÚrkeyÚremoval_verN©Ú__name__Ú
__module__Ú__qualname__Ú__annotations__© ó    úa/var/www/html/nodeJS/PythonScripts/venv3.11/lib/python3.11/site-packages/pandas/_config/config.pyr   r   Q   s<   € € € € € € Ø€H€H�HØ€O€O�OØÐÐÑØÐÐÑÐÐr   r   c                  óB   — e Zd ZU ded<   ded<   ded<   ded<   ded	<   d
S )ÚRegisteredOptionr   r   ÚobjectÚdefvalÚdocúCallable[[object], Any] | NoneÚ	validatorúCallable[[str], Any] | NoneÚcbNr   r   r   r    r"   r"   X   sE   € € € € € € Ø€H€H�HØ€N€N�NØ€H€H�HØ-Ð-Ð-Ñ-Ø#Ð#Ð#Ñ#Ð#Ð#r   r"   zdict[str, DeprecatedOption]Ú_deprecated_optionszdict[str, RegisteredOption]Ú_registered_optionsúdict[str, Any]Ú_global_configÚallú	list[str]Ú_reserved_keysc                  ó   — e Zd ZdZdS )ÚOptionErrorzÛ
    Exception raised for pandas.options.

    Backwards compatible with KeyError checks.

    Examples
    --------
    >>> pd.options.context
    Traceback (most recent call last):
    OptionError: No such option
    N)r   r   r   Ú__doc__r   r   r    r2   r2   m   s   € € € € € ð
ð 
ð 
ð 
r   r2   Úpatr   ÚsilentÚboolÚreturnc                ó>  — t          | ¦  «        }t          |¦  «        dk    r0|st          | ¦  «         t          dt	          | ¦  «        › �¦  «        ‚t          |¦  «        dk    rt          d¦  «        ‚|d         }|st          |¦  «         t          |¦  «        }|S )Nr   zNo such keys(s): é   zPattern matched multiple keys)Ú_select_optionsÚlenÚ_warn_if_deprecatedr2   ÚreprÚ_translate_key)r4   r5   Úkeysr   s       r    Ú_get_single_keyr@      s    € Ý˜3ÑÔ€DÝ
ˆ4�y„y�A‚~€~Øð 	%Ý Ñ$Ô$Ð$ÝÐ9­d°3©i¬iÐ9Ð9Ñ:Ô:Ð:Ý
ˆ4�y„y�1‚}€}ÝÐ9Ñ:Ô:Ð:Ø
ˆqŒ'€Càð !Ý˜CÑ Ô Ð å
˜Ñ
Ô
€Cà€Jr   Fr   c                óV   — t          | |¦  «        }t          |¦  «        \  }}||         S ©N)r@   Ú	_get_root)r4   r5   r   ÚrootÚks        r    Ú_get_optionrF   ‘   s+   € Ý
˜#˜vÑ
&Ô
&€Cõ ˜‰nŒn�G€Dˆ!Ø�Œ7€Nr   ÚNonec                 óÄ  — t          | ¦  «        }|r	|dz  dk    rt          d¦  «        ‚|                     dd¦  «        }|rAt          t	          |                     ¦   «         ¦  «        ¦  «        }t          d|› d�¦  «        ‚t          | d d d…         | dd d…         ¦  «        D ]º\  }}t          ||¦  «        }t          |¦  «        }|r|j
        r| 
                    |¦  «         t          |¦  «        \  }	}
||	|
<   |j        rZ|rCt          j        d	¬
¦  «        5  |                     |¦  «         d d d ¦  «         n# 1 swxY w Y   Œ¥|                     |¦  «         Œ»d S )Né   r   z4Must provide an even number of non-keyword argumentsr5   Fz2_set_option() got an unexpected keyword argument "ú"r9   T)Úrecord)r;   Ú
ValueErrorÚpopÚnextÚiterr?   Ú	TypeErrorÚzipr@   Ú_get_registered_optionr'   rC   r)   ÚwarningsÚcatch_warnings)ÚargsÚkwargsÚnargsr5   ÚkwargrE   Úvr   ÚorD   Úk_roots              r    Ú_set_optionr\   ™   s´  € å�‰IŒI€EØð Q�E˜A‘I ’N�NÝÐOÑPÔPÐPð �ZŠZ˜ %Ñ(Ô(€Fàð WÝ•T˜&Ÿ+š+™-œ-Ñ(Ô(Ñ)Ô)ˆÝÐUÈUÐUÐUÐUÑVÔVÐVå�D˜˜˜1˜”I˜t A D q DœzÑ*Ô*ð ð ‰ˆˆ1Ý˜a Ñ(Ô(ˆå" 3Ñ'Ô'ˆØð 	�”ð 	Ø�KŠK˜‰NŒNˆNõ ! ‘~”~‰ˆˆfØˆˆV‰àŒ4ð 	Øð ÝÔ,°DÐ9Ñ9Ô9ð ð Ø—D’D˜‘I”I�Iðð ð ñ ô ð ð ð ð ð ð øøøð ð ð ð øð —’�S‘	”	�	øð!ð s   ÄD>Ä>E	ÅE	Ú TÚ_print_descr   c                óÌ   — t          | ¦  «        }t          |¦  «        dk    rt          d¦  «        ‚d                     d„ |D ¦   «         ¦  «        }|rt	          |¦  «         d S |S )Nr   úNo such keys(s)ú
c                ó,   — g | ]}t          |¦  «        ‘ŒS r   )Ú_build_option_description)Ú.0rE   s     r    ú
<listcomp>z$_describe_option.<locals>.<listcomp>¾   s!   € Ð>Ð>Ð>°AÕ,¨QÑ/Ô/Ð>Ð>Ð>r   )r:   r;   r2   ÚjoinÚprint)r4   r^   r?   Úss       r    Ú_describe_optionri   ¹   sj   € Ý˜3ÑÔ€DÝ
ˆ4�y„y�A‚~€~ÝÐ+Ñ,Ô,Ð,à�	Š	Ð>Ð>¸Ð>Ñ>Ô>Ñ?Ô?€Aàð Ýˆa‰ŒˆØˆtØ€Hr   c                ó,  — t          | ¦  «        }t          |¦  «        dk    rt          d¦  «        ‚t          |¦  «        dk    r(t          | ¦  «        dk     r| dk    rt          d¦  «        ‚|D ]$}t	          |t
          |         j        |¬¦  «         Œ%d S )Nr   r`   r9   é   r.   z’You must specify at least 4 characters when resetting multiple keys, use the special keyword "all" to reset all the options to their default value©r5   )r:   r;   r2   rL   r\   r+   r$   )r4   r5   r?   rE   s       r    Ú_reset_optionrm   Æ   sª   € Ý˜3ÑÔ€Då
ˆ4�y„y�A‚~€~ÝÐ+Ñ,Ô,Ð,å
ˆ4�y„y�1‚}€}�˜S™œ Aš˜¨#°ª,¨,ÝðDñ
ô 
ð 	
ð ð Eð EˆÝ�AÕ*¨1Ô-Ô4¸VÐDÑDÔDÐDÐDðEð Er   c                óL   — t          | d¬¦  «        }t          |¦  «        j        S ©NTrl   )r@   rR   r$   )r4   r   s     r    Úget_default_valrp   ×   s%   € Ý
˜# dÐ
+Ñ
+Ô
+€CÝ! #Ñ&Ô&Ô-Ð-r   c                  ó@   — e Zd ZU dZded<   ddd	„Zdd„Zdd„Zdd„ZdS )ÚDictWrapperz/provide attribute-style access to a nested dictr,   Údr]   Úprefixr   r7   rG   c                óv   — t                                | d|¦  «         t                                | d|¦  «         d S )Nrs   rt   )r#   Ú__setattr__)Úselfrs   rt   s      r    Ú__init__zDictWrapper.__init__á   s8   € Ý×Ò˜4  aÑ(Ô(Ð(Ý×Ò˜4 ¨6Ñ2Ô2Ð2Ð2Ð2r   r   Úvalr   c                óä   — t                                | d¦  «        }|r|dz  }||z  }|| j        v r2t          | j        |         t          ¦  «        st          ||¦  «         d S t          d¦  «        ‚)Nrt   ú.z.You can only set the value of existing options)r#   Ú__getattribute__rs   Ú
isinstanceÚdictr\   r2   )rw   r   ry   rt   s       r    rv   zDictWrapper.__setattr__å   sw   € Ý×(Ò(¨¨xÑ8Ô8ˆØð 	Ø�c‰MˆFØ�#‰ˆð �$”&ˆ=ˆ=¥¨D¬F°3¬K½Ñ!>Ô!>ˆ=Ý˜ Ñ$Ô$Ð$Ð$Ð$åÐNÑOÔOÐOr   c                óB  — t                                | d¦  «        }|r|dz  }||z  }	 t                                | d¦  «        |         }n"# t          $ r}t          d¦  «        |‚d }~ww xY wt	          |t
          ¦  «        rt          ||¦  «        S t          |¦  «        S )Nrt   r{   rs   zNo such option)r#   r|   ÚKeyErrorr2   r}   r~   rr   rF   )rw   r   rt   rY   Úerrs        r    Ú__getattr__zDictWrapper.__getattr__ñ   s²   € Ý×(Ò(¨¨xÑ8Ô8ˆØð 	Ø�c‰MˆFØ�#‰ˆð	9Ý×'Ò'¨¨cÑ2Ô2°3Ô7ˆAˆAøÝð 	9ð 	9ð 	9ÝÐ.Ñ/Ô/°SÐ8øøøøð	9øøøå�a�ÑÔð 	'Ý˜q &Ñ)Ô)Ð)å˜vÑ&Ô&Ð&s   ©!A Á
A*ÁA%Á%A*r/   c                óN   — t          | j                             ¦   «         ¦  «        S rB   )Úlistrs   r?   )rw   s    r    Ú__dir__zDictWrapper.__dir__ÿ   s   € Ý�D”F—K’K‘M”MÑ"Ô"Ð"r   N)r]   )rs   r,   rt   r   r7   rG   )r   r   ry   r   r7   rG   ©r   r   )r7   r/   )	r   r   r   r3   r   rx   rv   r‚   r…   r   r   r    rr   rr   Ü   s�   € € € € € € Ø9Ð9àÐÐÑð3ð 3ð 3ð 3ð 3ð
Pð 
Pð 
Pð 
Pð'ð 'ð 'ð 'ð#ð #ð #ð #ð #ð #r   rr   c                  ó6   — e Zd Zdd„Zdd	„Zedd
„¦   «         ZdS )ÚCallableDynamicDocÚfuncúCallable[..., T]Údoc_tmplr   r7   rG   c                ó"   — || _         || _        d S rB   )Ú__doc_tmpl__Ú__func__)rw   r‰   r‹   s      r    rx   zCallableDynamicDoc.__init__  s   € Ø$ˆÔØˆŒˆˆr   r   c                ó   —  | j         |i |¤ŽS rB   )rŽ   )rw   rU   Úkwdss      r    Ú__call__zCallableDynamicDoc.__call__  s   € ØˆtŒ}˜dÐ+ dÐ+Ð+Ð+r   c                óÂ   — t          dd¬¦  «        }t          t          t                               ¦   «         ¦  «        ¦  «        }| j                             ||¬¦  «        S )Nr.   F)r^   )Ú	opts_descÚ	opts_list)ri   Úpp_options_listr„   r+   r?   r�   Úformat)rw   r“   r”   s      r    r3   zCallableDynamicDoc.__doc__  sR   € å$ U¸Ð>Ñ>Ô>ˆ	Ý#¥DÕ)<×)AÒ)AÑ)CÔ)CÑ$DÔ$DÑEÔEˆ	ØÔ ×'Ò'°)ÀyÐ'ÑQÔQÐQr   N)r‰   rŠ   r‹   r   r7   rG   )r7   r   )r7   r   )r   r   r   rx   r‘   Úpropertyr3   r   r   r    rˆ   rˆ     sb   € € € € € ðð ð ð ð,ð ,ð ,ð ,ð ðRð Rð Rñ „XðRð Rð Rr   rˆ   aÓ  
get_option(pat)

Retrieves the value of the specified option.

Available options:

{opts_list}

Parameters
----------
pat : str
    Regexp which should match a single option.
    Note: partial matches are supported for convenience, but unless you use the
    full option name (e.g. x.y.z.option_name), your code may break in future
    versions if new options with similar names are introduced.

Returns
-------
result : the value of the option

Raises
------
OptionError : if no such option exists

Notes
-----
Please reference the :ref:`User Guide <options>` for more information.

The available options with its descriptions:

{opts_desc}

Examples
--------
>>> pd.get_option('display.max_columns')  # doctest: +SKIP
4
aŒ  
set_option(pat, value)

Sets the value of the specified option.

Available options:

{opts_list}

Parameters
----------
pat : str
    Regexp which should match a single option.
    Note: partial matches are supported for convenience, but unless you use the
    full option name (e.g. x.y.z.option_name), your code may break in future
    versions if new options with similar names are introduced.
value : object
    New value of option.

Returns
-------
None

Raises
------
OptionError if no such option exists

Notes
-----
Please reference the :ref:`User Guide <options>` for more information.

The available options with its descriptions:

{opts_desc}

Examples
--------
>>> pd.set_option('display.max_columns', 4)
>>> df = pd.DataFrame([[1, 2, 3, 4, 5], [6, 7, 8, 9, 10]])
>>> df
   0  1  ...  3   4
0  1  2  ...  4   5
1  6  7  ...  9  10
[2 rows x 5 columns]
>>> pd.reset_option('display.max_columns')
a�  
describe_option(pat, _print_desc=False)

Prints the description for one or more registered options.

Call with no arguments to get a listing for all registered options.

Available options:

{opts_list}

Parameters
----------
pat : str
    Regexp pattern. All matching keys will have their description displayed.
_print_desc : bool, default True
    If True (default) the description(s) will be printed to stdout.
    Otherwise, the description(s) will be returned as a unicode string
    (for testing).

Returns
-------
None by default, the description(s) as a unicode string if _print_desc
is False

Notes
-----
Please reference the :ref:`User Guide <options>` for more information.

The available options with its descriptions:

{opts_desc}

Examples
--------
>>> pd.describe_option('display.max_columns')  # doctest: +SKIP
display.max_columns : int
    If max_cols is exceeded, switch to truncate view...
aÍ  
reset_option(pat)

Reset one or more options to their default value.

Pass "all" as argument to reset all options.

Available options:

{opts_list}

Parameters
----------
pat : str/regex
    If specified only options matching `prefix*` will be reset.
    Note: partial matches are supported for convenience, but unless you
    use the full option name (e.g. x.y.z.option_name), your code may break
    in future versions if new options with similar names are introduced.

Returns
-------
None

Notes
-----
Please reference the :ref:`User Guide <options>` for more information.

The available options with its descriptions:

{opts_desc}

Examples
--------
>>> pd.reset_option('display.max_columns')  # doctest: +SKIP
c                  ó*   — e Zd ZdZdd„Zdd„Zdd„ZdS )	Úoption_contextaF  
    Context manager to temporarily set options in the `with` statement context.

    You need to invoke as ``option_context(pat, val, [(pat, val), ...])``.

    Examples
    --------
    >>> from pandas import option_context
    >>> with option_context('display.max_rows', 10, 'display.max_columns', 5):
    ...     pass
    r7   rG   c           	     óÞ   — t          |¦  «        dz  dk    st          |¦  «        dk     rt          d¦  «        ‚t          t          |d d d…         |dd d…         ¦  «        ¦  «        | _        d S )NrI   r   z>Need to invoke as option_context(pat, val, [(pat, val), ...]).r9   )r;   rL   r„   rQ   Úops)rw   rU   s     r    rx   zoption_context.__init__×  sm   € Ýˆt‰9Œ9�q‰=˜AÒÐ¥ T¡¤¨Q¢ ÝØPñô ð õ �˜D   1 œI t¨A¨D¨q¨D¤zÑ2Ô2Ñ3Ô3ˆŒˆˆr   c                óp   — d„ | j         D ¦   «         | _        | j         D ]\  }}t          ||d¬¦  «         Œd S )Nc                ó6   — g | ]\  }}|t          |¦  «        f‘ŒS r   )rF   )rd   r4   ry   s      r    re   z,option_context.__enter__.<locals>.<listcomp>à  s)   € ÐFÐFÐF±°°c�c�; sÑ+Ô+Ð,ÐFÐFÐFr   Trl   )r›   Úundor\   )rw   r4   ry   s      r    Ú	__enter__zoption_context.__enter__ß  sP   € ØFÐF¸T¼XÐFÑFÔFˆŒ	àœð 	/ð 	/‰HˆC�Ý˜˜S¨Ð.Ñ.Ô.Ð.Ð.ð	/ð 	/r   c                óV   — | j         r| j         D ]\  }}t          ||d¬¦  «         Œd S d S ro   )rž   r\   )rw   rU   r4   ry   s       r    Ú__exit__zoption_context.__exit__å  sM   € ØŒ9ð 	3Ø œIð 3ð 3‘��SÝ˜C ¨TÐ2Ñ2Ô2Ð2Ð2ð	3ð 	3ð3ð 3r   N©r7   rG   )r   r   r   r3   rx   rŸ   r¡   r   r   r    r™   r™   Ê  sZ   € € € € € ð
ð 
ð4ð 4ð 4ð 4ð/ð /ð /ð /ð3ð 3ð 3ð 3ð 3ð 3r   r™   r   r$   r#   r%   r'   r&   r)   r(   c           
     ó¶  — ddl }ddl}|                      ¦   «         } | t          v rt	          d| › d�¦  «        ‚| t
          v rt	          d| › d�¦  «        ‚|r ||¦  «         |                      d¦  «        }|D ][}t          j        d|j	        z   dz   |¦  «        st          |› d	�¦  «        ‚|                     |¦  «        rt          |› d
�¦  «        ‚Œ\t          }	d}
t          |dd…         ¦  «        D ]i\  }}t          |	t          ¦  «        s>t	          |
                     d                     |d|…         ¦  «        ¬¦  «        ¦  «        ‚||	vri |	|<   |	|         }	Œjt          |	t          ¦  «        s>t	          |
                     d                     |dd…         ¦  «        ¬¦  «        ¦  «        ‚||	|d         <   t%          | ||||¬¦  «        t          | <   dS )aÎ  
    Register an option in the package-wide pandas config object

    Parameters
    ----------
    key : str
        Fully-qualified key, e.g. "x.y.option - z".
    defval : object
        Default value of the option.
    doc : str
        Description of the option.
    validator : Callable, optional
        Function of a single argument, should raise `ValueError` if
        called with a value which is not a legal value for the option.
    cb
        a function of a single argument "key", which is called
        immediately after an option value is set/reset. key is
        the full name of the option.

    Raises
    ------
    ValueError if `validator` is specified and `defval` is not a valid value.

    r   NúOption 'z' has already been registeredz' is a reserved keyr{   ú^ú$z is not a valid identifierz is a python keywordz5Path prefix to option '{option}' is already an optionéÿÿÿÿ)Úoption)r   r$   r%   r'   r)   )ÚkeywordÚtokenizeÚlowerr+   r2   r0   ÚsplitÚreÚmatchÚNamerL   Ú	iskeywordr-   Ú	enumerater}   r~   r–   rf   r"   )r   r$   r%   r'   r)   r©   rª   ÚpathrE   Úcursorr   ÚiÚps                r    Úregister_optionr¶   ë  s  € ð> €N€N€NØ€O€O€Oà
�)Š)‰+Œ+€Cà
Õ!Ð!Ð!ÝÐG SÐGÐGÐGÑHÔHÐHØ
�nÐÐÝÐ= SÐ=Ð=Ð=Ñ>Ô>Ð>ð ð Øˆ	�&ÑÔÐð �9Š9�S‰>Œ>€Dàð 9ð 9ˆÝŒx˜˜hœmÑ+¨cÑ1°1Ñ5Ô5ð 	?Ý Ð=Ð=Ð=Ñ>Ô>Ð>Ø×Ò˜QÑÔð 	9Ý Ð7Ð7Ð7Ñ8Ô8Ð8ð	9õ €FØ
A€Cå˜$˜s ˜sœ)Ñ$Ô$ð ð ‰ˆˆ1Ý˜&¥$Ñ'Ô'ð 	EÝ˜cŸjšj°·²¸¸b¸q¸b¼Ñ0BÔ0B˜jÑCÔCÑDÔDÐDØ�Fˆ?ˆ?ØˆF�1‰IØ˜”ˆˆå�f�dÑ#Ô#ð BÝ˜#Ÿ*š*¨C¯HªH°T¸#¸2¸#´YÑ,?Ô,?˜*Ñ@Ô@ÑAÔAÐAà€Fˆ4�Œ8Ñõ  0Ø˜ C°9Àð ñ  ô  Õ˜ÑÐÐr   r   r   r   c                óš   — |                       ¦   «         } | t          v rt          d| › d�¦  «        ‚t          | |||¦  «        t          | <   dS )a  
    Mark option `key` as deprecated, if code attempts to access this option,
    a warning will be produced, using `msg` if given, or a default message
    if not.
    if `rkey` is given, any access to the key will be re-routed to `rkey`.

    Neither the existence of `key` nor that if `rkey` is checked. If they
    do not exist, any subsequence access will fail as usual, after the
    deprecation warning is given.

    Parameters
    ----------
    key : str
        Name of the option to be deprecated.
        must be a fully-qualified option name (e.g "x.y.z.rkey").
    msg : str, optional
        Warning message to output when the key is referenced.
        if no message is given a default message will be emitted.
    rkey : str, optional
        Name of an option to reroute access to.
        If specified, any referenced `key` will be
        re-routed to `rkey` including set/get/reset.
        rkey must be a fully-qualified option name (e.g "x.y.z.rkey").
        used by the default message if no `msg` is specified.
    removal_ver : str, optional
        Specifies the version in which this option will
        be removed. used by the default message if no `msg` is specified.

    Raises
    ------
    OptionError
        If the specified key has already been deprecated.
    r¤   z)' has already been defined as deprecated.N)r«   r*   r2   r   )r   r   r   r   s       r    Údeprecate_optionr¸   6  sW   € ðN �)Š)‰+Œ+€Cà
Õ!Ð!Ð!ÝÐS SÐSÐSÐSÑTÔTÐTå/°°S¸$ÀÑLÔLÕ˜ÑÐÐr   c                ó”   ‡ — ‰ t           v r‰ gS t          t                                ¦   «         ¦  «        }‰ dk    r|S ˆ fd„|D ¦   «         S )zb
    returns a list of keys matching `pat`

    if pat=="all", returns all registered options
    r.   c                óT   •— g | ]$}t          j        ‰|t           j        ¦  «        ¯"|‘Œ%S r   )r­   ÚsearchÚI)rd   rE   r4   s     €r    re   z#_select_options.<locals>.<listcomp>x  s.   ø€ Ð7Ð7Ð7�!�rœy¨¨aµ´Ñ6Ô6Ð7ˆAÐ7Ð7Ð7r   )r+   Úsortedr?   )r4   r?   s   ` r    r:   r:   i  s\   ø€ ð Õ!Ð!Ð!Øˆuˆõ Õ%×*Ò*Ñ,Ô,Ñ-Ô-€DØ
ˆe‚|€|Øˆà7Ð7Ð7Ð7�tÐ7Ñ7Ô7Ð7r   útuple[dict[str, Any], str]c                óx   — |                       d¦  «        }t          }|d d…         D ]
}||         }Œ||d         fS )Nr{   r§   )r¬   r-   )r   r²   r³   rµ   s       r    rC   rC   {  sG   € Ø�9Š9�S‰>Œ>€DÝ€FØ�#�2�#ŒYð ð ˆØ˜”ˆˆØ�4˜”8ÐÐr   c                ó<   — |                       ¦   «         } | t          v S )z4Returns True if the given option has been deprecated)r«   r*   ©r   s    r    Ú_is_deprecatedrÂ   ƒ  s   € à
�)Š)‰+Œ+€CØÕ%Ð%Ð%r   c                óD   — 	 t           |          }|S # t          $ r Y dS w xY w)z±
    Retrieves the metadata for a deprecated option, if `key` is deprecated.

    Returns
    -------
    DeprecatedOption (namedtuple) if key is deprecated, None otherwise
    N)r*   r€   ©r   rs   s     r    Ú_get_deprecated_optionrÅ   ‰  s<   € ðÝ Ô$ˆð ˆøõ ð ð ð Øˆtˆtðøøøs   ‚ ‘
žc                ó6   — t                                | ¦  «        S )z¨
    Retrieves the option metadata if `key` is a registered option.

    Returns
    -------
    RegisteredOption (namedtuple) if key is deprecated, None otherwise
    )r+   ÚgetrÁ   s    r    rR   rR   ™  s   € õ ×"Ò" 3Ñ'Ô'Ð'r   c                ó:   — t          | ¦  «        }|r	|j        p| S | S )z‚
    if key id deprecated and a replacement key defined, will return the
    replacement key, otherwise returns `key` as - is
    )rÅ   r   rÄ   s     r    r>   r>   ¤  s*   € õ
 	˜sÑ#Ô#€AØð ØŒvˆ}˜Ðàˆ
r   c                óP  — t          | ¦  «        }|r”|j        r.t          j        |j        t          t          ¦   «         ¬¦  «         n]d| › d�}|j        r|d|j        › �z  }|j        r|d|j        › d�z  }n|dz  }t          j        |t          t          ¦   «         ¬¦  «         dS d	S )
zŸ
    Checks if `key` is a deprecated option and if so, prints a warning.

    Returns
    -------
    bool - True if `key` is deprecated, False otherwise.
    )Ú
stacklevelú'z' is deprecatedz and will be removed in z, please use 'z
' instead.z, please refrain from using it.TF)rÅ   r   rS   ÚwarnÚFutureWarningr   r   r   )r   rs   r   s      r    r<   r<   °  sÜ   € õ 	˜sÑ#Ô#€AØð ØŒ5ð 	MÝŒMØ”ÝÝ+Ñ-Ô-ðñ ô ð ð ð +�cÐ*Ð*Ð*ˆCØŒ}ð BØÐA°!´-ÐAÐAÑA�ØŒvð 9ØÐ:¨¬Ð:Ð:Ð:Ñ:��àÐ8Ñ8�åŒM˜#�}Õ9IÑ9KÔ9KÐLÑLÔLÐLØˆtØˆ5r   rE   c                óh  — t          | ¦  «        }t          | ¦  «        }| › d�}|j        rC|d                     |j                             ¦   «                              d¦  «        ¦  «        z  }n|dz  }|r|d|j        › dt          | d¦  «        › d�z  }|r|j        pd}|d	z  }|d
|› d�z  }|dz  }|S )zCBuilds a formatted description of a registered option and prints itú ra   zNo description available.z
    [default: z] [currently: Tú]r]   z
    (Deprecatedz, use `z
` instead.ú))	rR   rÅ   r%   rf   Ústripr¬   r$   rF   r   )rE   rZ   rs   rh   r   s        r    rc   rc   Î  sá   € å˜qÑ!Ô!€AÝ˜qÑ!Ô!€Aàˆˆˆ€Aà„uð )Ø	ˆT�YŠY�q”u—{’{‘}”}×*Ò*¨4Ñ0Ô0Ñ1Ô1Ñ1ˆˆà	Ð(Ñ(ˆàð PØ	ÐO ¤ÐOÐO½ÀAÀtÑ8LÔ8LÐOÐOÐOÑOˆàð ØŒvˆ|˜ˆØ	Ð Ñ ˆØ	Ð'�tÐ'Ð'Ð'Ñ'ˆØ	ˆS‰ˆà€Hr   éP   r?   úIterable[str]ÚwidthÚintÚ_printc                ó†  ‡‡
‡— ddl m} ddlmŠ dˆˆfd
„}g }d„ t	          | ¦  «        D ¦   «         }|r| |d|¦  «        z  }d„ | D ¦   «         }  |t	          | ¦  «        d„ ¦  «        D ]/\  Š
}ˆ
fd„t          |¦  «        D ¦   «         }| |‰
|¦  «        z  }Œ0d                     |¦  «        }	|rt          |	¦  «         dS |	S )z@Builds a concise listing of available options, grouped by prefixr   )Úgroupby)ÚwrapÚnamer   ÚksrÔ   r7   r/   c                óš   •— | rd| z   dz   nd} ‰d                      |¦  «        ‰|dd¬¦  «        }|r|d         r| r|d         d	z   |d<   |S )
Nz- z.[r]   z, z  F)Úinitial_indentÚsubsequent_indentÚbreak_long_wordsr§   rÐ   )rf   )rÛ   rÜ   ÚpfxÚlsrÕ   rÚ   s       €€r    Úppzpp_options_list.<locals>.ppë  s|   ø€ Ø$(Ð0ˆd�T‰k˜DÑ Ð ¨bˆØˆTØ�IŠI�b‰MŒMØØØ"Ø"ð
ñ 
ô 
ˆð ð 	"�"�R”&ð 	"˜Tð 	"Ø˜”V˜c‘\ˆBˆr‰FØˆ	r   c                óD   — g | ]}|                      d ¦  «        dk     ¯|‘ŒS ©r{   r   ©Úfind©rd   Úxs     r    re   z#pp_options_list.<locals>.<listcomp>ù  s'   € Ð:Ð:Ð:�Q¨!¯&ª&°©+¬+¸ª/¨/ˆq¨/¨/¨/r   r]   c                óD   — g | ]}|                      d ¦  «        dk    ¯|‘ŒS rå   ræ   rè   s     r    re   z#pp_options_list.<locals>.<listcomp>ü  s,   € Ð0Ð0Ð0�!˜qŸvšv c™{œ{¨aÒ/Ð/ˆAÐ/Ð/Ð/r   c                ó<   — | d |                       d¦  «        …         S ©Nr{   )Úrfind)ré   s    r    ú<lambda>z!pp_options_list.<locals>.<lambda>þ  s   € °°.°A·G²G¸C±L´L°.Ô0A€ r   c                óD   •— g | ]}|t          ‰¦  «        d z   d…         ‘ŒS )r9   N)r;   )rd   ré   rE   s     €r    re   z#pp_options_list.<locals>.<listcomp>ÿ  s+   ø€ Ð/Ð/Ð/ !ˆa•�A‘”˜‘
��ŒoÐ/Ð/Ð/r   ra   N)rÛ   r   rÜ   rÔ   r7   r/   )Ú	itertoolsrÙ   ÚtextwraprÚ   r½   r„   rf   rg   )r?   rÕ   r×   rÙ   rã   râ   ÚsinglesÚgrÜ   rh   rE   rÚ   s    `        @@r    r•   r•   æ  s#  øøø€ à!Ð!Ð!Ð!Ð!Ð!ØÐÐÐÐÐðð ð ð ð ð ð ð €BØ:Ð:�& ™,œ,Ð:Ñ:Ô:€GØð Ø
ˆbˆb��W‰oŒoÑˆØ0Ð0�tÐ0Ñ0Ô0€Dà��˜t™œÐ&AÐ&AÑBÔBð ð ‰ˆˆ1Ø/Ð/Ð/Ð/¥t¨A¡w¤wÐ/Ñ/Ô/ˆØ
ˆbˆb��B‰iŒi‰ˆˆØ�	Š	�"‰Œ€AØð Ýˆa‰Œˆˆˆàˆr   rt   úGenerator[None, None, None]c              #  óÎ   ‡ K  — dˆ fd„}t           }t          }t          } |t          ¦  «        a |t          ¦  «        a |t           ¦  «        a 	 dV — |a|a|a dS # |a|a|a w xY w)aÂ  
    contextmanager for multiple invocations of API with a common prefix

    supported API functions: (register / get / set )__option

    Warning: This is not thread - safe, and won't work properly if you import
    the API functions into your module using the "from x import y" construct.

    Example
    -------
    import pandas._config.config as cf
    with cf.config_prefix("display.font"):
        cf.register_option("color", "red")
        cf.register_option("size", " 5 pt")
        cf.set_option(size, " 6 pt")
        cf.get_option(size)
        ...

        etc'

    will register options "display.font.color", "display.font.size", set the
    value of "display.font.size"... and so on.
    r‰   r   r7   c                ó>   •‡ — dˆ ˆfd„}t          t          |¦  «        S )Nr   r   c                ó*   •— ‰› d| › �} ‰|g|¢R i |¤ŽS rì   r   )r   rU   r�   Úpkeyr‰   rt   s       €€r    Úinnerz*config_prefix.<locals>.wrap.<locals>.inner+  s6   ø€ ØÐ$Ð$˜sÐ$Ð$ˆDØ�4˜Ð,˜tÐ,Ð,Ð, tÐ,Ð,Ð,r   r†   )r   r   )r‰   rù   rt   s   ` €r    rÚ   zconfig_prefix.<locals>.wrap*  s7   øø€ ð	-ð 	-ð 	-ð 	-ð 	-ð 	-ð 	-õ •A�u‰~Œ~Ðr   N)r‰   r   r7   r   )r¶   Ú
get_optionÚ
set_option)rt   rÚ   Ú_register_optionrF   r\   s   `    r    Úconfig_prefixrý     s£   øè è € ð<ð ð ð ð ð õ 'ÐÝ€KÝ€KØ�•jÑ!Ô!€JØ�•jÑ!Ô!€JØ�d�?Ñ+Ô+€Oð+Øˆˆˆà ˆ
Ø ˆ
Ø*ˆˆˆøð !ˆ
Ø ˆ
Ø*ˆÐ*Ð*Ð*Ð*s   ÁA ÁA$Ú_typeú	type[Any]úCallable[[Any], None]c                ó   ‡ — dˆ fd„}|S )a  

    Parameters
    ----------
    `_type` - a type to be compared against (e.g. type(x) == `_type`)

    Returns
    -------
    validator - a function of a single argument x , which raises
                ValueError if type(x) is not equal to `_type`

    r7   rG   c                óT   •— t          | ¦  «        ‰k    rt          d‰› d�¦  «        ‚d S )NzValue must have type 'rË   )ÚtyperL   )ré   rþ   s    €r    rù   zis_type_factory.<locals>.innerQ  s6   ø€ Ý�‰7Œ7�eÒÐÝÐ>°eÐ>Ð>Ð>Ñ?Ô?Ð?ð Ðr   r¢   r   )rþ   rù   s   ` r    Úis_type_factoryr  C  s.   ø€ ð@ð @ð @ð @ð @ð @ð €Lr   c                óÌ   ‡ ‡— t          ‰ t          t          f¦  «        r8t          ‰ ¦  «        Š d                     t	          t
          ‰ ¦  «        ¦  «        Šnd‰ › d�Šdˆ ˆfd„}|S )zê

    Parameters
    ----------
    `_type` - the type to be checked against

    Returns
    -------
    validator - a function of a single argument x , which raises
                ValueError if x is not an instance of `_type`

    ú|rË   r7   rG   c                óL   •— t          | ‰¦  «        st          d‰› �¦  «        ‚d S )NzValue must be an instance of )r}   rL   )ré   rþ   Ú	type_reprs    €€r    rù   z"is_instance_factory.<locals>.innerk  s9   ø€ Ý˜!˜UÑ#Ô#ð 	JÝÐH¸YÐHÐHÑIÔIÐIð	Jð 	Jr   r¢   )r}   Útupler„   rf   Úmapr   )rþ   rù   r  s   ` @r    Úis_instance_factoryr  X  s€   øø€ õ �%�%¥˜Ñ'Ô'ð !Ý�e‘”ˆØ—H’H�S¥ e™_œ_Ñ-Ô-ˆ	ˆ	à ˜�L�L�Lˆ	ðJð Jð Jð Jð Jð Jð Jð €Lr   c                óH   ‡ ‡— d„ ‰ D ¦   «         Šd„ ‰ D ¦   «         Š dˆˆ fd„}|S )Nc                ó0   — g | ]}t          |¦  «        ¯|‘ŒS r   ©Úcallable©rd   Úcs     r    re   z%is_one_of_factory.<locals>.<listcomp>s  s#   € Ð8Ð8Ð8�q­H°Q©K¬KÐ8�Ð8Ð8Ð8r   c                ó0   — g | ]}t          |¦  «        °|‘ŒS r   r  r  s     r    re   z%is_one_of_factory.<locals>.<listcomp>t  s#   € Ð?Ð?Ð?˜!µ8¸A±;´;Ð?�AÐ?Ð?Ð?r   r7   rG   c                óÞ   •‡ — ‰ ‰vrdt          ˆ fd„‰D ¦   «         ¦  «        sKd„ ‰D ¦   «         }d                     |¦  «        }d|› �}t          ‰¦  «        r|dz  }t          |¦  «        ‚d S d S )Nc              3  ó.   •K  — | ]} |‰¦  «        V — Œd S rB   r   )rd   r  ré   s     €r    ú	<genexpr>z3is_one_of_factory.<locals>.inner.<locals>.<genexpr>x  s+   øè è € Ð/Ð/ �q�q˜‘t”tÐ/Ð/Ð/Ð/Ð/Ð/r   c                ó,   — g | ]}t          |¦  «        ‘ŒS r   )r   )rd   Úlvals     r    re   z4is_one_of_factory.<locals>.inner.<locals>.<listcomp>y  s   € Ð<Ð<Ð< t�˜T™œÐ<Ð<Ð<r   r  zValue must be one of z or a callable)Úanyrf   r;   rL   )ré   ÚuvalsÚ	pp_valuesr   Ú	callablesÚlegal_valuess   `   €€r    rù   z is_one_of_factory.<locals>.innerv  sš   øø€ Ø�LÐ Ð ÝÐ/Ð/Ð/Ð/ YÐ/Ñ/Ô/Ñ/Ô/ð &Ø<Ð<¨|Ð<Ñ<Ô<�ØŸHšH U™OœO�	Ø9¨iÐ9Ð9�Ý�y‘>”>ð ,ØÐ+Ñ+�CÝ  ‘o”oÐ%ð !Ð ð&ð &r   r¢   r   )r  rù   r  s   ` @r    Úis_one_of_factoryr  r  sT   øø€ Ø8Ð8˜LÐ8Ñ8Ô8€IØ?Ð?˜|Ð?Ñ?Ô?€Lð&ð &ð &ð &ð &ð &ð &ð €Lr   Úvaluec                óf   — | €dS t          | t          ¦  «        r| dk    rdS d}t          |¦  «        ‚)zö
    Verify that value is None or a positive int.

    Parameters
    ----------
    value : None or int
            The `value` to be checked.

    Raises
    ------
    ValueError
        When the value is not None or is a negative integer
    Nr   z+Value must be a nonnegative integer or None)r}   rÖ   rL   )r  r   s     r    Úis_nonnegative_intr   ƒ  s?   € ð €}Øˆå	�E�3Ñ	Ô	ð Ø�AŠ:ˆ:ØˆFà
7€CÝ
�S‰/Œ/Ðr   c                óB   — t          | ¦  «        st          d¦  «        ‚dS )z»

    Parameters
    ----------
    `obj` - the object to be checked

    Returns
    -------
    validator - returns True if object is callable
        raises ValueError otherwise.

    zValue must be a callableT)r  rL   )Úobjs    r    Úis_callabler#  ¥  s&   € õ �C‰=Œ=ð 5ÝÐ3Ñ4Ô4Ð4Øˆ4r   )r4   r   r5   r6   r7   r   )F)r4   r   r5   r6   r7   r   r¢   )r]   T)r4   r   r^   r6   r7   r   )r4   r   r5   r6   r7   rG   )r4   r   )r]   NN)r   r   r$   r#   r%   r   r'   r&   r)   r(   r7   rG   )NNN)
r   r   r   r   r   r   r   r   r7   rG   )r4   r   r7   r/   )r   r   r7   r¾   )r   r   r7   r6   r†   )r   r   r7   r   )rE   r   r7   r   )rÓ   F)r?   rÔ   rÕ   rÖ   r×   r6   )rt   r   r7   rô   )rþ   rÿ   r7   r   )r7   r   )r  r#   r7   rG   )r7   r6   )Nr3   Ú
__future__r   Ú
contextlibr   r   r­   Útypingr   r   r   r	   r
   r   rS   Úpandas._typingr   r   Úpandas.util._exceptionsr   Úcollections.abcr   r   r   r"   r*   r   r+   r-   r0   ÚAttributeErrorr€   r2   r@   rF   r\   ri   rm   rp   rr   rˆ   Ú_get_option_tmplÚ_set_option_tmplÚ_describe_option_tmplÚ_reset_option_tmplrú   rû   Úreset_optionÚdescribe_optionÚoptionsr™   r¶   r¸   r:   rC   rÂ   rÅ   rR   r>   r<   rc   r•   rý   r  r  r  r   rÖ   Úis_intr6   Úis_boolÚfloatÚis_floatr   Úis_strÚbytesÚis_textr#  r   r   r    ú<module>r9     s|  ðð0ð 0ð 0ðd #Ð "Ð "Ð "Ð "Ð "ðð ð ð ð ð ð ð ð 
€	€	€	ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð €€€ðð ð ð ð ð ð ð ð 5Ð 4Ð 4Ð 4Ð 4Ð 4àð ðð ð ð ð ð ð ð ðð ð ð ð �zñ ô ð ð$ð $ð $ð $ð $�zñ $ô $ð $ð 46Ð Ð 5Ð 5Ð 5Ñ 5ð 46Ð Ð 5Ð 5Ð 5Ñ 5ð "$€Ð #Ð #Ð #Ñ #ð #˜G€Ð #Ð #Ð #Ñ #ðð ð ð ð �. (ñ ô ð ð$ð ð ð ð$ð ð ð ð ðð ð ð ð@
ð 
ð 
ð 
ð 
ðEð Eð Eð Eð Eð".ð .ð .ð .ð
$#ð $#ð $#ð $#ð $#ñ $#ô $#ð $#ð`Rð Rð Rð Rð R˜ œñ Rô Rð Rð %Ð ðN-Ð ð^&Ð ðP"Ð ðL  Ð Ð-=Ñ>Ô>€
ØÐ Ð-=Ñ>Ô>€
Ø!Ð! -Ð1CÑDÔD€Ø$Ð$Ð%5Ð7LÑMÔM€Ø
ˆ+�nÑ
%Ô
%€ð3ð 3ð 3ð 3ð 3Ð%ñ 3ô 3ð 3ðH Ø04Ø&*ðHð Hð Hð Hð HðZ ØØ"ð	,Mð ,Mð ,Mð ,Mð ,Mðf8ð 8ð 8ð 8ð$ð ð ð ð&ð &ð &ð &ðð ð ð ð (ð (ð (ð (ð	ð 	ð 	ð 	ðð ð ð ð<ð ð ð ð0ð ð ð ð ðL ð/+ð /+ð /+ñ „ð/+ðlð ð ð ð*ð ð ð ð4ð ð ð ð"ð ð ð ð6 
ˆ˜Ñ	Ô	€Ø
ˆ/˜$Ñ
Ô
€Øˆ?˜5Ñ!Ô!€Ø	ˆ˜Ñ	Ô	€Ø
Ð
˜s E˜lÑ
+Ô
+€ðð ð ð ð ð r   