
    4ii                    *   % S r SSKJr  SSKJr  SSKrSSKJrJrJ	r	J
r
  SSKrSSKJr  SSKJr  \(       a
  SSKJr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S2S jrS3S jqS4S jq S5S6S jjr!S7S jr"S8S jr# " S S5      r$\$" \5      r%\&RO                  \%S S!5        \S9S" j5       r(   S:           S;S# jjq)   S<           S=S$ jjr*S>S% jr+S?S& jr,S@S' jr-S@S( jr.SAS) jr/SBS* jr0SCS+ jr1\SDS, j5       r2SES- jr3SFS. jr4SGS/ jr5SHS0 jr6\3" \75      r8\3" \95      r:\3" \;5      r<\3" \=5      r>\4" \=\?45      r@SIS1 jrAS![>        lB        S![@        lB        S!\!lB        S!\"lB        S!\(lB        g)Ja  
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)contextmanagerN)TYPE_CHECKINGAny
NamedTuplecast)F)find_stack_level)Callable	GeneratorSequencec                  H    \ rS rSr% S\S'   S\S'   S\S'   S\S'   S\S	'   S
rg)DeprecatedOptionJ   strkeytype[Warning]category
str | Nonemsgrkeyremoval_ver N__name__
__module____qualname____firstlineno____annotations____static_attributes__r       W/var/www/html/dynamic-report/venv/lib/python3.13/site-packages/pandas/_config/config.pyr   r   J   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)RegisteredOptionR   r   r   r   defvaldocCallable[[object], Any] | None	validatorCallable[[str], Any] | Nonecbr   Nr   r   r!   r"   r$   r$   R   s    	HK	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Srg)OptionErrorg   a  
Exception raised for pandas.options.

Backwards compatible with KeyError checks.

See Also
--------
options : Access and modify global pandas settings.

Examples
--------
>>> pd.options.context
Traceback (most recent call last):
OptionError: No such option
zpandas.errorsr   N)r   r   r   r   __doc__r    r   r!   r"   r4   r4   g   s      !Jr!   r4   c                    [        U 5      n[        U5      S:X  a  [        U 5        [        SU < 35      e[        U5      S:  a  [        S5      eUS   n[        U5        [	        U5      nU$ )Nr   zNo such keys(s):    zPattern matched multiple keys)_select_optionslen_warn_if_deprecatedr4   _translate_key)patkeysr   s      r"   _get_single_keyr?      si    3D
4yA~C -cW566
4y1}9::
q'C

CJr!   c                :    [        U 5      n[        U5      u  p#X#   $ )aR  
Retrieve the value of the specified option.

This method allows users to query the current value of a given option
in the pandas configuration system. Options control various display,
performance, and behavior-related settings within pandas.

Parameters
----------
pat : str
    Regexp which should match a single option.

    .. warning::

        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
-------
Any
    The value of the option.

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

See Also
--------
set_option : Set the value of the specified option or options.
reset_option : Reset one or more options to their default value.
describe_option : Print the description for one or more registered options.

Notes
-----
For all available options, please view the :ref:`User Guide <options.available>`
or use ``pandas.describe_option()``.

Examples
--------
>>> pd.get_option("display.max_columns")  # doctest: +SKIP
4
)r?   	_get_root)r=   r   rootks       r"   
get_optionrD      s#    X #
C nGD7Nr!   c                    [        U 5      S:X  a;  [        U S   [        5      (       a#  [        S U S   R	                  5        5       5      n [        U 5      nU(       a	  US-  S:w  a  [        S5      e[        U SSS2   U SSS2   SS9 Hy  u  p#[        U5      n[        U5      nU(       a"  UR                  (       a  UR                  U5        [        U5      u  pgX6U'   UR                  (       d  Mh  UR                  U5        M{     g)	al  
Set the value of the specified option or options.

This method allows fine-grained control over the behavior and display settings
of pandas. Options affect various functionalities such as output formatting,
display limits, and operational behavior. Settings can be modified at runtime
without requiring changes to global configurations or environment variables.

Parameters
----------
*args : str | object | dict
    Arguments provided in pairs, which will be interpreted as (pattern, value),
    or as a single dictionary containing multiple option-value pairs.
    pattern: str
    Regexp which should match a single option
    value: object
    New value of option

    .. warning::

        Partial pattern 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
    No return value.

Raises
------
ValueError if odd numbers of non-keyword arguments are provided
TypeError if keyword arguments are provided
OptionError if no such option exists

See Also
--------
get_option : Retrieve the value of the specified option.
reset_option : Reset one or more options to their default value.
describe_option : Print the description for one or more registered options.
option_context : Context manager to temporarily set options in a ``with``
    statement.

Notes
-----
For all available options, please view the :ref:`User Guide <options.available>`
or use ``pandas.describe_option()``.

Examples
--------
Option-Value Pair Input:

>>> 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")

Dictionary Input:

>>> pd.set_option({"display.max_columns": 4, "display.precision": 1})
>>> 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")
>>> pd.reset_option("display.precision")
r8   r   c              3  6   #    U  H  o  H  o"v   M     M     g 7fNr   .0itemkvs      r"   	<genexpr>set_option.<locals>.<genexpr>       CODdRdRO      z4Must provide an even number of non-keyword argumentsNTstrict)r:   
isinstancedicttupleitems
ValueErrorzipr?   _get_registered_optionr)   rA   r+   )argsnargsrC   vr   optrB   k_roots           r"   
set_optionr_      s    V 4yA~*T!Wd33CDGMMOCCIEEAINOPPD1ItADqDz$7a $S)3==MM! !~V666FF3K 8r!   c                    [        U 5      n[        U5      S:X  a  [        SU < 3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 )aK  
Print the description for one or more registered options.

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

Parameters
----------
pat : str, default ""
    String or string regexp pattern.
    Empty string will return all options.
    For regexp strings, 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 string
    (for testing).

Returns
-------
None
    If ``_print_desc=True``.
str
    If the description(s) as a string if ``_print_desc=False``.

See Also
--------
get_option : Retrieve the value of the specified option.
set_option : Set the value of the specified option or options.
reset_option : Reset one or more options to their default value.

Notes
-----
For all available options, please view the
:ref:`User Guide <options.available>`.

Examples
--------
>>> pd.describe_option("display.max_columns")  # doctest: +SKIP
display.max_columns : int
    If max_cols is exceeded, switch to truncate view...
r   No such keys(s) for pat=
N)r9   r:   r4   join_build_option_descriptionprint)r=   _print_descr>   rC   ss        r"   describe_optionrh   #  sg    R 3D
4yA~5788		>A,Q/>?AaH ?s   A*c                    [        U 5      n[        U5      S:X  a  [        SU < 35      e[        U5      S:  a   [        U 5      S:  a  U S:w  a  [        S5      eU H   n[	        U[
        U   R                  5        M"     g)ah  
Reset one or more options to their default value.

This method resets the specified pandas option(s) back to their default
values. It allows partial string matching for convenience, but users should
exercise caution to avoid unintended resets due to changes in option names
in future versions.

Parameters
----------
pat : str/regex
    If specified only options matching ``pat*`` will be reset.
    Pass ``"all"`` as argument to reset all options.

    .. warning::

        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
    No return value.

See Also
--------
get_option : Retrieve the value of the specified option.
set_option : Set the value of the specified option or options.
describe_option : Print the description for one or more registered options.

Notes
-----
For all available options, please view the
:ref:`User Guide <options.available>`.

Examples
--------
>>> pd.reset_option("display.max_columns")  # doctest: +SKIP
r   ra   r8      r0   zYou must specify at least 4 characters when resetting multiple keys, use the special keyword "all" to reset all the options to their default valueN)r9   r:   r4   rW   r_   r-   r&   r=   r>   rC   s      r"   reset_optionrl   X  s}    R 3D
4yA~5788
4y1}SA#,D
 	
 1)!,334 r!   c                B    [        U 5      n[        U5      R                  $ rG   )r?   rY   r&   )r=   r   s     r"   get_default_valrn     s    
#
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
)DictWrapperi  z/provide attribute-style access to a nested dictr.   dc                `    [         R                  U SU5        [         R                  U SU5        g )Nrq   prefix)object__setattr__)selfrq   rs   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)Nrs   .z.You can only set the value of existing options)rt   __getattribute__rq   rS   rT   r_   r4   )rv   r   valrs   s       r"   ru   DictWrapper.__setattr__  sZ    ((x8cMF &&=DFF3K!>!>v#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)Nrs   rz   rq   zNo such option)rt   r{   KeyErrorr4   rS   rT   rp   rD   )rv   r   rs   r\   errs        r"   __getattr__DictWrapper.__getattr__  s    ((x8cMF	9''c237A aq))f%%  	9./S8	9s   A, ,
B6BBc                H    [        U R                  R                  5       5      $ rG   )listrq   r>   )rv   s    r"   __dir__DictWrapper.__dir__  s    DFFKKM""r!   r   N) )rq   r.   rs   r   returnNone)r   r   r|   r   r   r   r   r   )r   r1   )r   r   r   r   r6   r   rw   ru   r   r   r    r   r!   r"   rp   rp     s     93
P&#r!   rp   r   pandasc            	   '    #    [        U 5      S:X  a;  [        U S   [        5      (       a#  [        S U S   R	                  5        5       5      n [        U 5      S-  S:w  d  [        U 5      S:  a  [        S5      e[        [        U SSS2   U SSS2   SS95      nS	n [        S
 U 5       5      nU H  u  p4[        X45        M     Sv   U H  u  p4[        X45        M     g! U H  u  p4[        X45        M     f = f7f)a  
Context manager to temporarily set options in a ``with`` statement.

This method allows users to set one or more pandas options temporarily
within a controlled block. The previous options' values are restored
once the block is exited. This is useful when making temporary adjustments
to pandas' behavior without affecting the global state.

Parameters
----------
*args : str | object | dict
    An even amount of arguments provided in pairs which will be
    interpreted as (pattern, value) pairs. Alternatively, a single
    dictionary of {pattern: value} may be provided.

Returns
-------
None
    No return value.

Yields
------
None
    No yield value.

See Also
--------
get_option : Retrieve the value of the specified option.
set_option : Set the value of the specified option.
reset_option : Reset one or more options to their default value.
describe_option : Print the description for one or more registered options.

Notes
-----
For all available options, please view the :ref:`User Guide <options.available>`
or use ``pandas.describe_option()``.

Examples
--------
>>> from pandas import option_context
>>> with option_context("display.max_rows", 10, "display.max_columns", 5):
...     pass
>>> with option_context({"display.max_rows": 10, "display.max_columns": 5}):
...     pass
r8   r   c              3  6   #    U  H  o  H  o"v   M     M     g 7frG   r   rH   s      r"   rL   !option_context.<locals>.<genexpr>  rN   rO   rP   zMProvide an even amount of arguments as option_context(pat, val, pat, val...).NTrQ   r   c              3  @   #    U  H  u  pU[        U5      4v   M     g 7frG   )rD   )rI   r=   r|   s      r"   rL   r      s     @Cc:c?+Cs   )r:   rS   rT   rU   rV   rW   rX   r_   )rZ   opsundor=   r|   s        r"   option_contextr     s     ^ 4yA~*T!Wd33CDGMMOCC
4y1}SY]5
 	

 D1ItADqDz$7
8C(*D!@C@@HCs  HCs  HCs  s   BC:,C C:C77C: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-   r4   r2   splitrematchNamerW   	iskeywordr/   	enumeraterS   rT   formatrc   r$   )r   r&   r'   r)   r+   r   r   pathrC   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#U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").
category : Warning
    Warning class for the deprecation.
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,   r4   r   )r   r   r   r   r   s        r"   deprecate_optionr   T  sB    T ))+C
!!HSE)RSTT/s+V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
r0   )r-   sortedr>   r   searchIrk   s      r"   r9   r9     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   r/   )r   r   r   r   s       r"   rA   rA     s8    99S>DF#2Y 8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   rq   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-   get)r   s    r"   rY   rY     s     ""3''r!   c                T    [        U 5      nU(       a  UR                  =(       d    U $ U $ )zv
if `key` is 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                  (       a3  [        R                  " U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UR                  [        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   warningswarnr   r
   r   r   )r   rq   r   s      r"   r;   r;     s     	s#A55MM

+-&  cU/*C}}1!--AAvvxz::88MM

+-
 r!   c                T   [        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(       as  [        R                  " 5          [        R                  " S[        5        [        R                  " S[        5        USUR                   S[        U 5       S3-  nSSS5        U(       a(  UR                  =(       d    S	nUS
-  nUSU S3-  nUS-  nU$ ! , (       d  f       N?= f)zCBuilds a formatted description of a registered option and prints it rb   zNo description available.ignorez
    [default: z] [currently: ]Nr   z
    (Deprecatedz, use `z
` instead.))rY   r   r'   rc   stripr   r   catch_warningssimplefilterFutureWarningDeprecationWarningr&   rD   r   )rC   orq   rg   r   s        r"   rd   rd     s    q!Aq!A#QAuu	TYYquu{{}**4011	(($$&!!(M:!!(,>?#AHH:^JqM?!LLA '
 	vv|	  	wtfJ''	SH '&s   
AD
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$ )Nrz   r   )r   rZ   kwdspkeyfuncrs   s       r"   inner*config_prefix.<locals>.wrap.<locals>.inner*  s(    XQse$D,t,t,,r!   r   )r   r	   )r   r   rs   s   ` r"   wrapconfig_prefix.<locals>.wrap)  s    	- 	- Au~r!   N)r   r	   r   r	   )r   rD   r_   )rs   r   _register_option_get_option_set_options   `    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   )typerW   )x_types    r"   r   is_type_factory.<locals>.innerP  s)    7e5eWA>?? r!   r   r   r   )r   r   s   ` r"   is_type_factoryr   B  s    @ Lr!   c                   ^ ^ [        T [        5      (       a   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 )rS   rW   )r   r   	type_reprs    r"   r   "is_instance_factory.<locals>.inneri  s(    !U##<YKHII $r!   r   )rS   rU   rc   mapr   )r   r   r   s   ` @r"   is_instance_factoryr   W  sF     %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rG   r   )rI   cr   s     r"   rL   3is_one_of_factory.<locals>.inner.<locals>.<genexpr>v  s     /YqttYs   r   zValue must be one of z or a callable)anyr   rc   r:   rW   )r   lvaluvals	pp_valuesr   	callableslegal_valuess   `    r"   r    is_one_of_factory.<locals>.innert  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   p  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)rS   intrW   )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   rW   )objs    r"   is_callabler     s     C==344r!   )r=   r   r   r   )r=   r   r   r   r   )r   T)r=   r   rf   boolr   r   )r=   r   r   r   )r=   r   )r   Generator[None])r   NN)r   r   r&   rt   r'   r   r)   r(   r+   r*   r   r   )NNN)r   r   r   r   r   r   r   r   r   r   r   r   )r=   r   r   r1   )r   r   r   ztuple[dict[str, Any], str]r   )r   r   r   r   )r   r   r   r   )rC   r   r   r   )rs   r   r   r   )r   z	type[Any]r   Callable[[Any], None])r   ztype | tuple[type, ...]r   r   )r   r   r   r   )r   rt   r   r   )r   rt   r   r   )Cr6   
__future__r   
contextlibr   r   typingr   r   r   r   r   pandas._typingr	   pandas.util._exceptionsr
   collections.abcr   r   r   r   r$   r,   r   r-   r/   r2   AttributeErrorr   r4   r?   rD   r_   rh   rl   rn   rp   optionsrt   ru   r   r   r   r9   rA   r   rY   r<   r;   rd   r   r   r   r   r   r   is_intr   is_boolfloatis_floatr   is_strbytesis_textr   r   r   r!   r"   <module>r	     sK  0d # % 	    4 z $z $ 46 0 5 46 0 5 "$ # #G	 #!.( !0 0f^B2j65r.
$# $#N n
%   7L( 3 @! @!L 04&*H	HH 
H .	H
 	$H 
H\ "/W	/W/W 
/W 	/W
 /W 
/Wl8$ (	D< /+ /+l*2"6 
	
$
5!		
sEl
+& !
  
 % " $ r!   