
    Mhnc                    L   % S r SSKJr  SSKJrJr  SSKrSSKJrJ	r	J
r
JrJrJr  SSKrSSKJrJr  SSKJr  \(       a  SSKJrJr   " S	 S
\5      r " S S\5      r0 rS\S'   0 rS\S'   0 rS\S'   S/rS\S'    " S S\\5      r S9S jr!S:S;S jjr"S<S jr#S=S>S jjr$S:S?S jjr%S@S jr& " S S5      r' " S  S!\\   5      r(S"r)S#r*S$r+S%r,\(" \"\)5      q-\(" \#\*5      q.\(" \%\,5      r/\(" \$\+5      r0\'" \5      r1 " S& S'\5      r2   SA           SBS( jjq3   SC         SDS) jjr4SES* jr5SFS+ jr6SGS, jr7SHS- jr8SHS. jr9SIS/ jr:SGS0 jr;SJS1 jr<SKSLS2 jjr=\SMS3 j5       r>SNS4 jr?SOS5 jr@SOS6 jrASPS7 jrB\?" \C5      rD\?" \E5      rF\?" \G5      rH\?" \I5      rJ\@" \I\K45      rLSQS8 jrMg)Ra  
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                  >    \ rS rSr% S\S'   S\S'   S\S'   S\S'   Srg	)
DeprecatedOptionQ   strkey
str | Nonemsgrkeyremoval_ver N__name__
__module____qualname____firstlineno____annotations____static_attributes__r       G/var/www/html/env/lib/python3.13/site-packages/pandas/_config/config.pyr   r   Q   s    	H	O
r"   r   c                  H    \ rS rSr% S\S'   S\S'   S\S'   S\S'   S	\S
'   Srg)RegisteredOptionX   r   r   objectdefvaldocCallable[[object], Any] | None	validatorCallable[[str], Any] | Nonecbr   Nr   r   r"   r#   r%   r%   X   s    	HN	H--##r"   r%   zdict[str, DeprecatedOption]_deprecated_optionszdict[str, RegisteredOption]_registered_optionsdict[str, Any]_global_configall	list[str]_reserved_keysc                      \ rS rSrSrSrg)OptionErrorm   z
Exception raised for pandas.options.

Backwards compatible with KeyError checks.

Examples
--------
>>> pd.options.context
Traceback (most recent call last):
OptionError: No such option
r   N)r   r   r   r   __doc__r!   r   r"   r#   r6   r6   m   s    
r"   r6   c                   [        U 5      n[        U5      S:X  a)  U(       d  [        U 5        [        S[	        U 5       35      e[        U5      S:  a  [        S5      eUS   nU(       d  [        U5        [        U5      nU$ )Nr   zNo such keys(s):    zPattern matched multiple keys)_select_optionslen_warn_if_deprecatedr6   repr_translate_key)patsilentkeysr   s       r#   _get_single_keyrC      ss    3D
4yA~$-d3i[9::
4y1}9::
q'CC 

CJr"   c                :    [        X5      n[        U5      u  p4X4   $ N)rC   	_get_root)r@   rA   r   rootks        r#   _get_optionrI      s     
#
&C nGD7Nr"   c                    [        U 5      nU(       a	  US-  S:w  a  [        S5      eUR                  SS5      nU(       a1  [        [	        UR                  5       5      5      n[        SU S35      e[        U S S S2   U SS S2   5       H  u  pV[        XS5      n[        U5      nU(       a"  UR                  (       a  UR                  U5        [        U5      u  pXiU
'   UR                  (       d  Mh  U(       a0  [        R                  " S	S
9   UR                  U5        S S S 5        M  UR                  U5        M     g ! , (       d  f       M  = f)N   r   z4Must provide an even number of non-keyword argumentsrA   Fz2_set_option() got an unexpected keyword argument ""r:   T)record)r<   
ValueErrorpopnextiterrB   	TypeErrorziprC   _get_registered_optionr+   rF   r-   warningscatch_warnings)argskwargsnargsrA   kwargrH   vr   orG   k_roots              r#   _set_optionr^      s   IEEAINOPP ZZ%(FT&++-()LUGSTUVVD1ItADqDz*a("3'KKN !~V444,,D9DDI :9 S	! + :9s   D>>
E	c                    [        U 5      n[        U5      S:X  a  [        S5      eSR                  U Vs/ s H  n[	        U5      PM     sn5      nU(       a  [        U5        g U$ s  snf )Nr   No such keys(s)
)r;   r<   r6   join_build_option_descriptionprint)r@   _print_descrB   rH   ss        r#   _describe_optionrg      s]    3D
4yA~+,,		>A,Q/>?AaH ?s   A&c                    [        U 5      n[        U5      S:X  a  [        S5      e[        U5      S:  a   [        U 5      S:  a  U S:w  a  [        S5      eU H  n[	        U[
        U   R                  US9  M!     g )Nr   r`   r:      r2   zYou must specify at least 4 characters when resetting multiple keys, use the special keyword "all" to reset all the options to their default valuerA   )r;   r<   r6   rN   r^   r/   r(   )r@   rA   rB   rH   s       r#   _reset_optionrk      su    3D
4yA~+,,
4y1}SA#,D
 	
 A*1-44VD r"   c                @    [        U SS9n[        U5      R                  $ NTrj   )rC   rT   r(   )r@   r   s     r#   get_default_valrn      s    
#d
+C!#&---r"   c                  P    \ rS rSr% SrS\S'   SSS jjrSS jrSS jrSS jr	S	r
g
)DictWrapper   z/provide attribute-style access to a nested dictr0   dc                `    [         R                  U SU5        [         R                  U SU5        g )Nrr   prefix)r'   __setattr__)selfrr   rt   s      r#   __init__DictWrapper.__init__   s&    4a(462r"   c                    [         R                  U S5      nU(       a  US-  nX1-  nXR                  ;   a.  [        U R                  U   [        5      (       d  [        X25        g [        S5      e)Nrt   .z.You can only set the value of existing options)r'   __getattribute__rr   
isinstancedictr^   r6   )rv   r   valrt   s       r#   ru   DictWrapper.__setattr__   sZ    ((x8cMF &&=DFF3K!>!>$NOOr"   c                   [         R                  U S5      nU(       a  US-  nX!-  n [         R                  U S5      U   n[	        U[
        5      (       a  [        X25      $ [        U5      $ ! [         a  n[        S5      UeS nAff = f)Nrt   rz   rr   zNo such option)r'   r{   KeyErrorr6   r|   r}   rp   rI   )rv   r   rt   r[   errs        r#   __getattr__DictWrapper.__getattr__   s    ((x8cMF	9''c237A aq))v&&  	9./S8	9s   A, ,
B6BBc                H    [        U R                  R                  5       5      $ rE   )listrr   rB   )rv   s    r#   __dir__DictWrapper.__dir__   s    DFFKKM""r"   r   N) )rr   r0   rt   r   returnNone)r   r   r~   r   r   r   r   r   )r   r3   )r   r   r   r   r8   r    rw   ru   r   r   r!   r   r"   r#   rp   rp      s     93
P'#r"   rp   c                  <    \ rS rSrSS jrSS jr\S	S j5       rSrg)
CallableDynamicDoci  c                    X l         Xl        g rE   __doc_tmpl____func__)rv   funcdoc_tmpls      r#   rw   CallableDynamicDoc.__init__  s    $r"   c                &    U R                   " U0 UD6$ rE   )r   )rv   rW   kwdss      r#   __call__CallableDynamicDoc.__call__  s    }}d+d++r"   c                    [        SSS9n[        [        [        R	                  5       5      5      nU R
                  R                  XS9$ )Nr2   F)re   )	opts_desc	opts_list)rg   pp_options_listr   r/   rB   r   format)rv   r   r   s      r#   r8   CallableDynamicDoc.__doc__  sA    $U>	#D)<)A)A)C$DE	  '')'QQr"   r   N)r   zCallable[..., T]r   r   r   r   )r   r   )r   r   )	r   r   r   r   rw   r   propertyr8   r!   r   r"   r#   r   r     s"    , 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                  6    \ rS rSrSrSS jrSS jrSS jrSrg)	option_contexti  a&  
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
c           	         [        U5      S-  S:w  d  [        U5      S:  a  [        S5      e[        [        US S S2   USS S2   5      5      U l        g )NrK   r   z>Need to invoke as option_context(pat, val, [(pat, val), ...]).r:   )r<   rN   r   rS   ops)rv   rW   s     r#   rw   option_context.__init__  sS    t9q=ATQP  D1ItADqDz23r"   c                    U R                    VVs/ s H  u  pU[        U5      4PM     snnU l        U R                    H  u  p[        XSS9  M     g s  snnf rm   )r   rI   undor^   )rv   r@   r~   s      r#   	__enter__option_context.__enter__  sH    =AXXFXc;s+,XF	HC. ! Gs   Ac                f    U R                   (       a   U R                    H  u  p#[        X#SS9  M     g g rm   )r   r^   )rv   rW   r@   r~   s       r#   __exit__option_context.__exit__  s(    99 IICT2 & r"   )r   r   Nr   r   )	r   r   r   r   r8   rw   r   r   r!   r   r"   r#   r   r     s    
4/3r"   r   c           
     ,   SSK nSSKnU R                  5       n U [        ;   a  [	        SU  S35      eU [
        ;   a  [	        SU  S35      eU(       a  U" U5        U R                  S5      nU Ha  n[        R                  " SUR                  -   S-   U5      (       d  [        U S	35      eUR                  U5      (       d  MU  [        U S
35      e   [        n	Sn
[        USS 5       HQ  u  p[        U	[        5      (       d*  [	        U
R!                  SR#                  USU 5      S95      eX;  a  0 X'   X   n	MS     [        U	[        5      (       d*  [	        U
R!                  SR#                  USS 5      S95      eXUS   '   [%        XX#US9[        U '   g)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 keyrz   ^$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/   r6   r4   splitrematchNamerN   	iskeywordr1   	enumerater|   r}   r   rb   r%   )r   r(   r)   r+   r-   r   r   pathrH   cursorr   ips                r#   register_optionr     s   > 
))+C
!!HSE)FGHH
nHSE)<=>> & 99S>Dxxhmm+c1155s"<=>>Qs"6788	  F
AC$s)$&$''cjjbq0BjCDD?FI % fd###**CHHT#2Y,?*@AA48  0C r"   c                |    U R                  5       n U [        ;   a  [        SU  S35      e[        XX#5      [        U '   g)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.   r6   r   )r   r   r   r   s       r#   deprecate_optionr   6  s@    N ))+C
!!HSE)RSTT/$Lr"   c                    U [         ;   a  U /$ [        [         R                  5       5      nU S:X  a  U$ U Vs/ s H1  n[        R                  " X[        R
                  5      (       d  M/  UPM3     sn$ s  snf )zV
returns a list of keys matching `pat`

if pat=="all", returns all registered options
r2   )r/   sortedrB   r   searchI)r@   rB   rH   s      r#   r;   r;   i  s_     !!u %**,-D
e|7t!ryy6At777s   .A2)A2c                \    U R                  S5      n[        nUS S  H  nX#   nM	     X!S   4$ )Nrz   r   )r   r1   )r   r   r   r   s       r#   rF   rF   {  s8    99S>DF#2Y 8r"   c                4    U R                  5       n U [        ;   $ )z4Returns True if the given option has been deprecated)r   r.   r   s    r#   _is_deprecatedr     s    
))+C%%%r"   c                :     [         U    nU$ ! [         a     gf = f)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   rr   s     r#   _get_deprecated_optionr     s,    $   s   	 
c                ,    [         R                  U 5      $ )z
Retrieves the option metadata if `key` is a registered option.

Returns
-------
RegisteredOption (namedtuple) if key is deprecated, None otherwise
)r/   getr   s    r#   rT   rT     s     ""3''r"   c                T    [        U 5      nU(       a  UR                  =(       d    U $ U $ )zv
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vv}
r"   c                   [        U 5      nU(       a  UR                  (       a-  [        R                  " UR                  [        [        5       S9  gSU  S3nUR                  (       a  USUR                   3-  nUR                  (       a  USUR                   S3-  nOUS-  n[        R                  " U[        [        5       S9  gg	)
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   rU   warnFutureWarningr   r   r   )r   rr   r   s      r#   r=   r=     s     	s#A55MM+-  cU/*C}}1!--AAvvxz::88MM#}9I9KLr"   c                   [        U 5      n[        U 5      nU  S3nUR                  (       a<  USR                  UR                  R	                  5       R                  S5      5      -  nOUS-  nU(       a   USUR                   S[        U S5       S3-  nU(       a(  UR                  =(       d    SnUS	-  nUS
U S3-  nUS-  nU$ )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.))	rT   r   r)   rb   stripr   r(   rI   r   )rH   r\   rr   rf   r   s        r#   rc   rc     s    q!Aq!A#QAuu	TYYquu{{}**4011	((	zAt8L7MQOOvv|	  	wtfJ''	SHr"   c                  ^^ SSK Jn  SSKJm  SUU4S jjn/ n[	        U 5       Vs/ s H  ofR                  S5      S:  d  M  UPM     nnU(       a  XT" SU5      -  nU  Vs/ s H  ofR                  S5      S:  d  M  UPM     n nU" [	        U 5      S 5       H8  u  p[        U	5       Vs/ s H  of[        U5      S-   S	 PM     n
nXT" X5      -  nM:     S
R                  U5      nU(       a  [        U5        g	U$ s  snf s  snf s  snf )z@Builds a concise listing of available options, grouped by prefixr   )groupby)wrapc                   > U (       a  SU -   S-   OSnT" SR                  U5      TUSSS9nU(       a  US   (       a  U (       a  US   S	-   US'   U$ )
Nz- z.[r   z, z  F)initial_indentsubsequent_indentbreak_long_wordsr   r   )rb   )namekspfxlswidthr   s       r#   pppp_options_list.<locals>.pp  sY    $(dTkD bIIbM""
 "R&TVc\BrF	r"   rz   r   c                *    U S U R                  S5       $ Nrz   )rfind)xs    r#   <lambda>!pp_options_list.<locals>.<lambda>  s    .AGGCL0Ar"   r:   Nra   )r   r   r   Iterable[str]r   r3   )
	itertoolsr   textwrapr   r   findr   r<   rb   rd   )rB   r   _printr   r   r   r   singlesrH   gr   rf   r   s    `          @r#   r   r     s    !  B ,:,Q&&+/q,G:
bWo0t!vvc{a/AtD0t&AB'+Aw/w!A
ow/
bi C 			"Aa ; 1 0s   C:C:!C?=C?*Dc              #     ^ #    SU 4S jjn[         n[        n[        nU" [        5      qU" [        5      qU" [         5      q  Sv   UqUqUq g! UqUqUq f = f7f)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.
c                8   >^  SU U4S jjn[        [        U5      $ )Nc                *   > T SU  3nT" U/UQ70 UD6$ r   r   )r   rW   r   pkeyr   rt   s       r#   inner*config_prefix.<locals>.wrap.<locals>.inner+  s(    XQse$D,t,t,,r"   r   )r   r   )r   r   rt   s   ` r#   r   config_prefix.<locals>.wrap*  s    	- 	- Au~r"   N)r   r   r   r   )r   
get_option
set_option)rt   r   _register_optionrI   r^   s   `    r#   config_prefixr    sd     < 'KKj!Jj!J?+O+ 
 
* !
 
*s   ?AA AAAc                   ^  SU 4S jjnU$ )z

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`

c                B   > [        U 5      T:w  a  [        ST S35      eg )NzValue must have type 'r   )typerN   )r   _types    r#   r   is_type_factory.<locals>.innerQ  s)    7e5eWA>?? r"   r   r   )r  r   s   ` r#   is_type_factoryr  C  s    @ Lr"   c                   ^ ^ [        T [        [        45      (       a+  [        T 5      m SR                  [	        [
        T 5      5      mOST  S3mSU U4S jjnU$ )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   c                D   > [        U T5      (       d  [        ST 35      eg )NzValue must be an instance of )r|   rN   )r   r  	type_reprs    r#   r   "is_instance_factory.<locals>.innerk  s(    !U##<YKHII $r"   r   )r|   tupler   rb   mapr   )r  r   r  s   ` @r#   is_instance_factoryr  X  sS     %%''eHHSe_-	waL	J J Lr"   c                   ^ ^ T  Vs/ s H  n[        U5      (       d  M  UPM     snmT  Vs/ s H  n[        U5      (       a  M  UPM     snm SUU 4S jjnU$ s  snf s  snf )Nc                   >^  T T;  al  [        U 4S jT 5       5      (       dQ  T Vs/ s H  n[        U5      PM     nnSR                  U5      nSU 3n[        T5      (       a  US-  n[	        U5      eg g s  snf )Nc              3  2   >#    U  H  o" T5      v   M     g 7frE   r   ).0cr   s     r#   	<genexpr>3is_one_of_factory.<locals>.inner.<locals>.<genexpr>x  s     /YqttYs   r	  zValue must be one of z or a callable)anyr   rb   r<   rN   )r   lvaluvals	pp_valuesr   	callableslegal_valuess   `    r#   r    is_one_of_factory.<locals>.innerv  sx    L /Y////;<|tT|<HHUO	-i[9y>>++C o% 0 !<s   A6r   )callable)r  r  r   r  s   `  @r#   is_one_of_factoryr  r  sP    (8LqHQKL8I+?|!8A;A|?L& & L 9?s   AAAAc                \    U c  g[        U [        5      (       a  U S:  a  gSn[        U5      e)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|   intrN   )valuer   s     r#   is_nonnegative_intr#    s2     }	E3		A:
7C
S/r"   c                :    [        U 5      (       d  [        S5      eg)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  rN   )objs    r#   is_callabler&    s     C==344r"   )r@   r   rA   boolr   r   )F)r@   r   rA   r'  r   r   r   )r   T)r@   r   re   r'  r   r   )r@   r   rA   r'  r   r   )r@   r   )r   NN)r   r   r(   r'   r)   r   r+   r*   r-   r,   r   r   )NNN)
r   r   r   r   r   r   r   r   r   r   )r@   r   r   r3   )r   r   r   ztuple[dict[str, Any], str])r   r   r   r'  r   )r   r   r   r   )rH   r   r   r   )P   F)rB   r   r   r!  r   r'  )rt   r   r   zGenerator[None, None, None])r  z	type[Any]r   Callable[[Any], None])r   r)  )r"  r'   r   r   )r   r'  )Nr8   
__future__r   
contextlibr   r   r   typingr   r   r   r	   r
   r   rU   pandas._typingr   r   pandas.util._exceptionsr   collections.abcr   r   r   r%   r.   r    r/   r1   r4   AttributeErrorr   r6   rC   rI   r^   rg   rk   rn   rp   r   _get_option_tmpl_set_option_tmpl_describe_option_tmpl_reset_option_tmplr   r   reset_optiondescribe_optionoptionsr   r   r   r;   rF   r   r   rT   r?   r=   rc   r   r  r  r  r  r#  r!  is_intr'  is_boolfloatis_floatr   is_strbytesis_textr&  r   r"   r#   <module>r?     sp  0d # 
   5z $z $ 46 0 5 46 0 5 "$ # #G	 #.( $$@
E".
$# $#`R R % N- ^& P" L  -=>
-=>
!-1CD$%57LM
n
%3% 3H 04&*H	HH 
H .	H
 	$H 
HZ "	,M	,M	,M ,M 	,M
 
,Mf8$& (	<0L /+ /+l*4"6 
	
$
5!		
sEl
+r"   