
    Wh`                    >   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mZ ddlZddlmZmZ ddl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dZdZd[d\dZ d]d!Z!d^d_d&Z"d[d`d'Z#dad(Z$ G d) d*          Z% G d+ d,e
e                   Z&d-Z'd.Z(d/Z)d0Z* e&e e'          a+ e&e!e(          a, e&e#e*          a- e&e"e)          Z. e%e          Z/ G d1 d2e          Z0	 	 	 dbdcd;a1	 	 	 ddded?Z2dfd@Z3dgdBZ4dhdCZ5didDZ6didEZ7djdFZ8dhdGZ9dkdIZ:dldmdNZ;edndP            Z<dodTZ=dpdUZ>dpdVZ?dqdXZ@ e=eA          ZB e=eC          ZD e=eE          ZF e=eG          ZH e>eGeIf          ZJdrdYZKdS )sa  
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)AnyCallableGenericIterableIterator
NamedTuplecast)FT)find_stack_levelc                  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__     [/var/www/html/movieo_spanner_bot/venv/lib/python3.11/site-packages/pandas/_config/config.pyr   r   L   s<         HHHOOO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!   S   sE         HHHNNNHHH----######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.
    N)r   r   r   __doc__r   r   r   r1   r1   h   s           r   r1   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_deprecatedr1   repr_translate_key)r3   r4   keysr   s       r   _get_single_keyr?   t   s    3D
4yyA~~ 	%$$$9d3ii99:::
4yy1}}9:::
q'C !C   


CJr   Fr   c                V    t          | |          }t          |          \  }}||         S N)r?   	_get_root)r3   r4   r   rootks        r   _get_optionrE      s+    
#v
&
&C nnGD!7Nr   Nonec                    t          |           }|r	|dz  dk    rt          d          |                    dd          }|r:t          |                                          d         }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 argumentsr4   Fz2_set_option() got an unexpected keyword argument ""r8   T)record)r:   
ValueErrorpoplistr>   	TypeErrorzipr?   _get_registered_optionr&   rB   r(   warningscatch_warnings)
argskwargsnargsr4   kwargrD   vr   orC   s
             r   _set_optionrY      s   IIE QEAINNOPPP ZZ%((F WV[[]]##A&UUUUUVVVD1ItADqDz**  1a(("3'' 	 	KKNNN C..aQ4 	 ,D999  DDIII               S			! s   D77D;	>D;	 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).0rD   s     r   
<listcomp>z$_describe_option.<locals>.<listcomp>   s!    >>>A,Q//>>>r   )r9   r:   r1   joinprint)r3   r[   r>   ss       r   _describe_optionrf      sj    3D
4yyA~~+,,,		>>>>>??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]   r8      r-   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r4   )r9   r:   r1   rK   rY   r*   r#   )r3   r4   r>   rD   s       r   _reset_optionrj      s    3D
4yyA~~+,,,
4yy1}}SA#,,D
 
 	
  E EA*1-4VDDDDDE Er   c                L    t          | d          }t          |          j        S NTri   )r?   rP   r#   )r3   r   s     r   get_default_valrm      s%    
#d
+
+
+C!#&&--r   c                  4    e Zd ZdZddd	ZddZddZddZdS )DictWrapperz/provide attribute-style access to a nested dictrZ   dr+   prefixr   r6   rF   c                v    t                               | d|           t                               | d|           d S )Nrp   rq   )r"   __setattr__)selfrp   rq   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          )Nrq   .z.You can only set the value of existing options)r"   __getattribute__rp   
isinstancedictrY   r1   )rt   r   rv   rq   s       r   rs   zDictWrapper.__setattr__   sw    ((x88 	cMF# $&==DF3K!>!>=$$$$$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 )Nrq   rx   rp   zNo such option)r"   ry   KeyErrorr1   rz   r{   ro   rE   )rt   r   rq   rW   errs        r   __getattr__zDictWrapper.__getattr__   s    ((x88 	cMF#	9''c2237AA 	9 	9 	9.//S8	9a 	'q&)))v&&&s   !A 
A*A%%A*Iterable[str]c                N    t          | j                                                  S rA   )rM   rp   r>   )rt   s    r   __dir__zDictWrapper.__dir__   s    DFKKMM"""r   N)rZ   )rp   r+   rq   r   r6   rF   )r   r   rv   r   r6   rF   r   r   )r6   r   )r   r   r   r2   ru   rs   r   r   r   r   r   ro   ro      ss        993 3 3 3 3
P 
P 
P 
P' ' ' '# # # # # #r   ro   c                  6    e Zd ZddZdd	Zedd
            ZdS )CallableDynamicDocfuncCallable[..., T]doc_tmplr   r6   rF   c                "    || _         || _        d S rA   )__doc_tmpl____func__)rt   r   r   s      r   ru   zCallableDynamicDoc.__init__  s    $r   r   c                     | j         |i |S rA   )r   )rt   rS   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)rf   pp_options_listrM   r*   r>   r   format)rt   r   r   s      r   r2   zCallableDynamicDoc.__doc__
  sR    $U>>>	#D)<)A)A)C)C$D$DEE	 '')y'QQQr   N)r   r   r   r   r6   rF   )r6   r   )r6   r   )r   r   r   ru   r   propertyr2   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}
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}
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}
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}
c                  *    e Zd ZdZddZddZddZdS )	option_contexta  
    Context manager to temporarily set options in the `with` statement context.

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

    Examples
    --------
    >>> with option_context('display.max_rows', 10, 'display.max_columns', 5):
    ...     pass
    r6   rF   c           	         t          |          dz  dk    st          |          dk     rt          d          t          t          |d d d         |dd d                             | _        d S )NrH   r   z>Need to invoke as option_context(pat, val, [(pat, val), ...]).r8   )r:   rK   rM   rO   ops)rt   rS   s     r   ru   zoption_context.__init__  sm    t99q=ATQP   D1ItADqDz2233r   c                p    d | j         D             | _        | j         D ]\  }}t          ||d           d S )Nc                :    g | ]\  }}|t          |d           fS )Tri   )rE   )ra   r3   rv   s      r   rb   z,option_context.__enter__.<locals>.<listcomp>  s.    SSShc3c;s48889SSSr   Tri   )r   undorY   )rt   r3   rv   s      r   	__enter__zoption_context.__enter__  sP    SS$(SSS	 	/ 	/HCS.....	/ 	/r   c                V    | j         r| j         D ]\  }}t          ||d           d S d S rl   )r   rY   )rt   rS   r3   rv   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r6   rF   )r   r   r   r2   ru   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 keyrx   ^$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*   r1   r/   splitrematchNamerK   	iskeywordr,   	enumeraterz   r{   r   rc   r!   )r   r#   r$   r&   r(   r   r   pathrD   cursorr   ips                r   register_optionr     s   > NNNOOO
))++C
!!!GSGGGHHH
n=S===>>>  	& 99S>>D 9 9xhm+c1155 	?===>>>Q 	9777888	9 F
AC$ss)$$  1&$'' 	Ecjjbqb0B0BjCCDDDF??F1Ifd## B#**CHHT#2#Y,?,?*@@AAAF48  0C9     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)   r1   r   )r   r   r   r   s       r   deprecate_optionr     sW    N ))++C
!!!SS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)ra   rD   r3   s     r   rb   z#_select_options.<locals>.<listcomp>R  s.    777!rya667A777r   )r*   sortedr>   )r3   r>   s   ` r   r9   r9   C  s\     !!!u %**,,--D
e||7777t7777r   tuple[dict[str, Any], str]c                x    |                      d          }t          }|d d         D ]
}||         }||d         fS )Nrx   r   )r   r,   )r   r   r   r   s       r   rB   rB   U  sG    99S>>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   rp   s     r   _get_deprecated_optionr   c  s<    $     tt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   rP   rP   s  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   rQ   warnFutureWarningr   r   r   )r   rp   r   s      r   r;   r;     s     	s##A 5 	MM+--     +c***C} BA!-AAAv 9:::::88M#}9I9K9KLLLLt5r   rD   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 r^   zNo description available.z
    [default: z] [currently: T]rZ   z
    (Deprecatedz, use `z
` instead.))	rP   r   r$   rc   stripr   r#   rE   r   )rD   rX   rp   re   r   s        r   r`   r`     s    q!!Aq!!AAu )	TYYqu{{}}**400111	(( P	OOOAt8L8LOOOO v|	  	't''''	SHr   P   r>   r   _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   r6   r.   c                    | rd| z   dz   nd} d                     |          |dd          }|r|d         r| r|d         d	z   |d<   |S )
Nz- z.[rZ   z, z  F)initial_indentsubsequent_indentbreak_long_wordsr   r   )rc   )r   r   pfxlswidthr   s       r   ppzpp_options_list.<locals>.pp  s|    $(0dTkD  bTIIbMM""
 
 
  	""R& 	"T 	"Vc\BrF	r   c                D    g | ]}|                     d           dk     |S rx   r   findra   xs     r   rb   z#pp_options_list.<locals>.<listcomp>  s'    :::Q!&&++//q///r   rZ   c                D    g | ]}|                     d           dk    |S r   r   r   s     r   rb   z#pp_options_list.<locals>.<listcomp>  s,    000!qvvc{{a//A///r   c                <    | d |                      d                   S Nrx   )rfind)r   s    r   <lambda>z!pp_options_list.<locals>.<lambda>  s    .AGGCLL.0A r   c                D    g | ]}|t                    d z   d         S )r8   N)r:   )ra   r   rD   s     r   rb   z#pp_options_list.<locals>.<listcomp>  s+    ///!aA
o///r   r^   N)r   r   r   r   r6   r.   )	itertoolsr   textwrapr   r   rM   rc   rd   )r>   r   r   r   r   r   singlesgr   re   rD   r   s    `        @@r   r   r     s#   !!!!!!       B::&,,:::G 
bbWoo00t000Dt&A&ABB  1////tAww///
bbBii		"A ar   Iterator[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   r6   c                >     d fd}t          t          |          S )Nr   r   c                *     d|  } |g|R i |S r   r   )r   rS   r   pkeyr   rq   s       r   innerz*config_prefix.<locals>.wrap.<locals>.inner  s6    $$s$$D4,t,,,t,,,r   r   )r   r   )r   r   rq   s   ` r   r   zconfig_prefix.<locals>.wrap  s7    	- 	- 	- 	- 	- 	- 	- Au~~r   N)r   r   r6   r   )r   
get_option
set_option)rq   r   _register_optionrE   rY   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`

    r6   rF   c                T    t          |           k    rt          d d          d S )NzValue must have type 'r   )typerK   )r   r   s    r   r   zis_type_factory.<locals>.inner+  s6    77e>e>>>??? r   r   r   )r   r   s   ` r   is_type_factoryr     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   r6   rF   c                L    t          |           st          d           d S )NzValue must be an instance of )rz   rK   )r   r   	type_reprs    r   r   z"is_instance_factory.<locals>.innerE  s9    !U## 	JHYHHIII	J 	Jr   r   )rz   tuplerM   rc   mapr   )r   r   r  s   ` @r   is_instance_factoryr  2  s     %%'' !eHHSe__--		 LLL	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ra   cs     r   rb   z%is_one_of_factory.<locals>.<listcomp>N  s#    888qHQKK8888r   c                0    g | ]}t          |          |S r   r	  r  s     r   rb   z%is_one_of_factory.<locals>.<listcomp>O  s#    ???!8A;;?A???r   r6   rF   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 rA   r   )ra   r  r   s     r   	<genexpr>z3is_one_of_factory.<locals>.inner.<locals>.<genexpr>T  s+      //qqtt//////r   c                ,    g | ]}t          |          S r   )r   )ra   lvals     r   rb   z4is_one_of_factory.<locals>.inner.<locals>.<listcomp>U  s    <<<tT<<<r   r  zValue must be one of z or a callable)anyrc   r:   rK   )r   uvals	pp_valuesr   	callableslegal_valuess   `   r   r   z is_one_of_factory.<locals>.innerQ  s    L  ////Y///// &<<|<<<HHUOO	9i99y>> ,++C oo% ! & &r   r   r   )r  r   r  s   ` @r   is_one_of_factoryr  L  sT    88L888I??|???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)rz   intrK   )r  r   s     r   is_nonnegative_intr  _  s?     }	E3		 A::F
7C
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
  rK   )objs    r   is_callabler    s&     C== 534444r   )r3   r   r4   r5   r6   r   )F)r3   r   r4   r5   r6   r   r   )rZ   T)r3   r   r[   r5   r6   r   )r3   r   r4   r5   r6   rF   )r3   r   )rZ   NN)r   r   r#   r"   r$   r   r&   r%   r(   r'   r6   rF   )NNN)
r   r   r   r   r   r   r   r   r6   rF   )r3   r   r6   r.   )r   r   r6   r   )r   r   r6   r5   r   )r   r   r6   r   )rD   r   r6   r   )r   F)r>   r   r   r5   )r6   r   )r   r   r6   r   )r6   r   )r  r"   r6   rF   )r6   r5   )Lr2   
__future__r   
contextlibr   r   r   typingr   r   r   r	   r
   r   r   rQ   pandas._typingr   r   pandas.util._exceptionsr   r   r!   r)   r   r*   r,   r/   AttributeErrorr}   r1   r?   rE   rY   rf   rj   rm   ro   r   _get_option_tmpl_set_option_tmpl_describe_option_tmpl_reset_option_tmplr   r   reset_optiondescribe_optionoptionsr   r   r   r9   rB   r   r   rP   r=   r;   r`   r   r   r   r  r  r  r  is_intr5   is_boolfloatis_floatr   is_strbytesis_textr  r   r   r   <module>r4     sV  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   D" H  D D  -=>>
-=>>
!!-1CDD$$%57LMM
+n
%
%3 3 3 3 3% 3 3 3F 04&*H H H H HZ "	,M ,M ,M ,M ,Mf8 8 8 8$   & & & &    ( ( ( (	 	 	 	   <   0    L /+ /+ /+ /+l   *   4   &   6 
		
/$

?5!!			

sEl
+
+     r   