a
    oÝEb(]  ã                   @  sÖ  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 ddlZddlmZ G dd„ deƒZG d	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„ deeƒZddddœdd„Zdkdddœdd„Zdd œd!d"„Zdlddd%œd&d'„Zdmddddœd(d)„Zdd*œd+d,„ZG d-d.„ d.ƒZ G d/d0„ d0ƒZ!d1Z"d2Z#d3Z$d4Z%e!ee"ƒa&e!ee#ƒa'e!ee%ƒa(e!ee$ƒZ)e eƒZ*G d5d6„ d6eƒZ+dndd7dd8d9dd:œd;d<„a,dodd=d=d=dd>œd?d@„Z-dddAœdBdC„Z.ddDdEœdFdG„Z/dddEœdHdI„Z0ddJœdKdL„Z1ddJœdMdN„Z2dddEœdOdP„Z3dddEœdQdR„Z4dddSœdTdU„Z5dpdWddXœdYdZ„Z6ed[d\„ ƒZ7d]d^d_œd`da„Z8d^d œdbdc„Z9d^d œddde„Z:d7ddfœdgdh„Z;e8e<ƒZ=e8e>ƒZ?e8e@ƒZAe8eBƒZCe9eBeDfƒZEdd œdidj„ZFdS )qaò  
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ÚIterableÚ
NamedTupleÚcast)ÚFc                   @  s.   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__© r   r   úU/home/ja/django-apps/lartica_env/lib/python3.9/site-packages/pandas/_config/config.pyr   F   s   
r   c                   @  s6   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   M   s
   
r   zdict[str, DeprecatedOption]Ú_deprecated_optionszdict[str, RegisteredOption]Ú_registered_optionsúdict[str, Any]Ú_global_configÚallú	list[str]Ú_reserved_keysc                   @  s   e Zd ZdZdS )ÚOptionErrorzV
    Exception for pandas.options, backwards compatible with KeyError
    checks.
    N)r   r   r   Ú__doc__r   r   r   r   r(   b   s   r(   r   Úbool)ÚpatÚsilentÚreturnc                 C  sf   t | ƒ}t|ƒdkr2|s t| ƒ tdt| ƒ› �ƒ‚t|ƒdkrFtdƒ‚|d }|sZt|ƒ t|ƒ}|S )Nr   zNo such keys(s): é   zPattern matched multiple keys)Ú_select_optionsÚlenÚ_warn_if_deprecatedr(   ÚreprÚ_translate_key)r+   r,   Úkeysr   r   r   r   Ú_get_single_keym   s    r5   F)r+   r,   c                 C  s   t | |ƒ}t|ƒ\}}|| S ©N)r5   Ú	_get_root)r+   r,   r   ÚrootÚkr   r   r   Ú_get_option   s    
r:   ÚNone©r-   c            
   	   O  s  t | ƒ}|r|d dkr tdƒ‚| dd¡}|rPt| ¡ ƒd }td|› d�ƒ‚t| d d d… | dd d… ƒD ]Ž\}}t||ƒ}t|ƒ}|rœ|j	rœ| 	|¡ t
|ƒ\}	}||	|< |jrn|ròtjd	d
�� | |¡ W d   ƒ qü1 sæ0    Y  qn| |¡ qnd S )Né   r   z4Must provide an even number of non-keyword argumentsr,   Fz2_set_option() got an unexpected keyword argument "ú"r.   T)Úrecord)r0   Ú
ValueErrorÚpopÚlistr4   Ú	TypeErrorÚzipr5   Ú_get_registered_optionr   r7   r    ÚwarningsÚcatch_warnings)
ÚargsÚkwargsÚnargsr,   Úkwargr9   Úvr   Úor8   r   r   r   Ú_set_option‡   s&    &


*rN   Ú T)r+   Ú_print_descc                 C  sF   t | ƒ}t|ƒdkrtdƒ‚d dd„ |D ƒ¡}|r>t|ƒ n|S d S )Nr   úNo such keys(s)Ú
c                 S  s   g | ]}t |ƒ‘qS r   )Ú_build_option_description©Ú.0r9   r   r   r   Ú
<listcomp>­   ó    z$_describe_option.<locals>.<listcomp>)r/   r0   r(   ÚjoinÚprint)r+   rP   r4   Úsr   r   r   Ú_describe_option§   s    
r[   c                 C  sf   t | ƒ}t|ƒdkrtdƒ‚t|ƒdkrDt| ƒdk rD| dkrDtdƒ‚|D ]}t|t| j|d� qHd S )Nr   rQ   r.   é   r%   z’You must specify at least 4 characters when resetting multiple keys, use the special keyword "all" to reset all the options to their default value©r,   )r/   r0   r(   r@   rN   r"   r   )r+   r,   r4   r9   r   r   r   Ú_reset_optionµ   s     ÿr^   ©r+   c                 C  s   t | dd�}t|ƒjS ©NTr]   )r5   rE   r   )r+   r   r   r   r   Úget_default_valÇ   s    ra   c                   @  sP   e Zd ZdZddddœdd„Zddd	d
œdd„Zddœdd„Zddœdd„ZdS )ÚDictWrapperz/provide attribute-style access to a nested dictrO   r#   r   )ÚdÚprefixc                 C  s    t  | d|¡ t  | d|¡ d S )Nrc   rd   )r   Ú__setattr__)Úselfrc   rd   r   r   r   Ú__init__Ï   s    zDictWrapper.__init__r   r;   )r   Úvalr-   c                 C  sR   t  | d¡}|r|d7 }||7 }|| jv rFt| j| tƒsFt||ƒ ntdƒ‚d S )Nrd   Ú.z.You can only set the value of existing options)r   Ú__getattribute__rc   Ú
isinstanceÚdictrN   r(   )rf   r   rh   rd   r   r   r   re   Ó   s    zDictWrapper.__setattr__©r   c              
   C  s„   t  | d¡}|r|d7 }||7 }zt  | d¡| }W n. tyb } ztdƒ|‚W Y d }~n
d }~0 0 t|tƒrxt||ƒS t|ƒS d S )Nrd   ri   rc   zNo such option)r   rj   ÚKeyErrorr(   rk   rl   rb   r:   )rf   r   rd   rL   Úerrr   r   r   Ú__getattr__ß   s     

zDictWrapper.__getattr__úIterable[str]r<   c                 C  s   t | j ¡ ƒS r6   )rB   rc   r4   )rf   r   r   r   Ú__dir__í   s    zDictWrapper.__dir__N)rO   )r   r   r   r)   rg   re   rp   rr   r   r   r   r   rb   Ì   s
   rb   c                   @  s(   e Zd Zdd„ Zdd„ Zedd„ ƒZdS )ÚCallableDynamicDocc                 C  s   || _ || _d S r6   )Ú__doc_tmpl__Ú__func__)rf   ÚfuncZdoc_tmplr   r   r   rg   û   s    zCallableDynamicDoc.__init__c                 O  s   | j |i |¤ŽS r6   )ru   )rf   rH   Úkwdsr   r   r   Ú__call__ÿ   s    zCallableDynamicDoc.__call__c                 C  s,   t ddd�}ttt ¡ ƒƒ}| jj||d�S )Nr%   F)rP   )Ú	opts_descÚ	opts_list)r[   Úpp_options_listrB   r"   r4   rt   Úformat)rf   ry   rz   r   r   r   r)     s    zCallableDynamicDoc.__doc__N)r   r   r   rg   rx   Úpropertyr)   r   r   r   r   rs   ú   s   rs   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
-----
The available options with its descriptions:

{opts_desc}
aG  
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
-----
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
-----
The available options with its descriptions:

{opts_desc}
a5  
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
-----
The available options with its descriptions:

{opts_desc}
c                   @  s(   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
    c                 G  sL   t |ƒd dkst |ƒdk r$tdƒ‚tt|d d d… |dd d… ƒƒ| _d S )Nr=   r   z>Need to invoke as option_context(pat, val, [(pat, val), ...]).r.   )r0   r@   rB   rD   Úops)rf   rH   r   r   r   rg   ¡  s
    ÿzoption_context.__init__c                 C  s4   dd„ | j D ƒ| _| j D ]\}}t||dd� qd S )Nc                 S  s    g | ]\}}|t |d d�f‘qS )Tr]   )r:   )rU   r+   rh   r   r   r   rV   ª  rW   z,option_context.__enter__.<locals>.<listcomp>Tr]   )r   ÚundorN   )rf   r+   rh   r   r   r   Ú	__enter__©  s    zoption_context.__enter__c                 G  s(   | j r$| j D ]\}}t||dd� qd S r`   )r€   rN   )rf   rH   r+   rh   r   r   r   Ú__exit__¯  s    zoption_context.__exit__N)r   r   r   r)   rg   r�   r‚   r   r   r   r   r~   •  s   r~   r   r   r   )r   r   r   r   r    r-   c                 C  sV  ddl }ddl}|  ¡ } | tv r0td| › d�ƒ‚| tv rHtd| › d�ƒ‚|rT||ƒ |  d¡}|D ]@}t d|j	 d |¡sŠt
|› d	�ƒ‚| |¡rbt
|› d
�ƒ‚qbt}	d}
t|dd… ƒD ]H\}}t|	tƒsìt|
jd |d|… ¡d�ƒ‚||	vrüi |	|< |	| }	q¼t|	tƒ�s0t|
jd |dd… ¡d�ƒ‚||	|d < t| ||||d�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 keyri   ú^ú$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"   r(   r'   ÚsplitÚreÚmatchÚNamer@   Ú	iskeywordr$   Ú	enumeraterk   rl   r|   rX   r   )r   r   r   r   r    rˆ   r‰   Úpathr9   Úcursorr   ÚiÚpr   r   r   Úregister_optionµ  s:    




ÿr•   r   )r   r   r   r   r-   c                 C  s6   |   ¡ } | 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!   r(   r   )r   r   r   r   r   r   r   Údeprecate_option   s    'r–   )r+   r-   c                   s8   ˆ t v rˆ gS tt  ¡ ƒ}ˆ dkr&|S ‡ fdd„|D ƒS )zb
    returns a list of keys matching `pat`

    if pat=="all", returns all registered options
    r%   c                   s    g | ]}t  ˆ |t j¡r|‘qS r   )rŒ   ÚsearchÚIrT   r_   r   r   rV   B  rW   z#_select_options.<locals>.<listcomp>)r"   Úsortedr4   )r+   r4   r   r_   r   r/   3  s    r/   ztuple[dict[str, Any], str])r   r-   c                 C  s4   |   d¡}t}|d d… D ]}|| }q||d fS )Nri   r†   )r‹   r$   )r   r‘   r’   r”   r   r   r   r7   E  s
    

r7   c                 C  s   |   ¡ } | tv S )z4Returns True if the given option has been deprecated)rŠ   r!   rm   r   r   r   Ú_is_deprecatedM  s    rš   rm   c                 C  s*   zt |  }W n ty    Y dS 0 |S dS )z±
    Retrieves the metadata for a deprecated option, if `key` is deprecated.

    Returns
    -------
    DeprecatedOption (namedtuple) if key is deprecated, None otherwise
    N)r!   rn   ©r   rc   r   r   r   Ú_get_deprecated_optionS  s
    rœ   c                 C  s
   t  | ¡S )z¨
    Retrieves the option metadata if `key` is a registered option.

    Returns
    -------
    RegisteredOption (namedtuple) if key is deprecated, None otherwise
    )r"   Úgetrm   r   r   r   rE   c  s    rE   c                 C  s   t | ƒ}|r|jp| S | S dS )z‚
    if key id deprecated and a replacement key defined, will return the
    replacement key, otherwise returns `key` as - is
    N)rœ   r   r›   r   r   r   r3   n  s    
r3   c                 C  sz   t | ƒ}|rv|jr"t |jt¡ nPd| › d�}|jrD|d|j› �7 }|jr^|d|j› d�7 }n|d7 }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.
    ú'z' is deprecatedz and will be removed in z, please use 'z
' instead.z, please refrain from using it.TF)rœ   r   rF   ÚwarnÚFutureWarningr   r   )r   rc   r   r   r   r   r1   z  s    r1   )r9   r-   c                 C  s˜   t | ƒ}t| ƒ}| › d�}|jr<|d |j ¡  d¡¡7 }n|d7 }|rf|d|j› dt| dƒ› d�7 }|r”|jprd}|d	7 }|d
|› d�7 }|d7 }|S )zCBuilds a formatted description of a registered option and prints itú rR   zNo description available.z
    [default: z] [currently: Tú]rO   z
    (Deprecatedz, use `z
` instead.ú))	rE   rœ   r   rX   Ústripr‹   r   r:   r   )r9   rM   rc   rZ   r   r   r   r   rS   ”  s    

rS   éP   rq   )r4   Ú_printc           
        sÆ   ddl m} ddlm‰ ddddœ‡‡fdd	„}g }d
d„ t| ƒD ƒ}|rX||d|ƒ7 }dd„ | D ƒ} |t| ƒdd„ ƒD ],\‰ }‡ fdd„t|ƒD ƒ}||ˆ |ƒ7 }qxd |¡}	|r¾t|	ƒ n|	S dS )z@Builds a concise listing of available options, grouped by prefixr   )Úgroupby)Úwrapr   rq   r&   )ÚnameÚksr-   c                   sP   | rd|  d nd}ˆd  |¡ˆ |ddd�}|rL|d rL| rL|d d	 |d< |S )
Nz- z.[rO   z, z  F)Úinitial_indentÚsubsequent_indentÚbreak_long_wordsr†   r¢   )rX   )r©   rª   ÚpfxÚls)Úwidthr¨   r   r   Úpp±  s    ûzpp_options_list.<locals>.ppc                 S  s   g | ]}|  d ¡dk r|‘qS ©ri   r   ©Úfind©rU   Úxr   r   r   rV   ¿  rW   z#pp_options_list.<locals>.<listcomp>rO   c                 S  s   g | ]}|  d ¡dkr|‘qS r²   r³   rµ   r   r   r   rV   Â  rW   c                 S  s   | d |   d¡… S ©Nri   )Úrfind©r¶   r   r   r   Ú<lambda>Ä  rW   z!pp_options_list.<locals>.<lambda>c                   s    g | ]}|t ˆ ƒd  d… ‘qS )r.   N)r0   rµ   )r9   r   r   rV   Å  rW   rR   N)Ú	itertoolsr§   Útextwrapr¨   r™   rB   rX   rY   )
r4   r°   r¦   r§   r±   r¯   ZsinglesÚgrª   rZ   r   )r9   r°   r¨   r   r{   ¬  s    

r{   c                 #  sb   dddœ‡ fdd„}t }t}t}|tƒa|tƒa|t ƒa zdV  W |a|a|a n|a|a|a 0 dS )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
   )rv   r-   c                   s   ddœ‡ ‡fdd„}t t|ƒS )Nr   rm   c                   s$   ˆ› d| › �}ˆ |g|¢R i |¤ŽS r·   r   )r   rH   rw   Úpkey)rv   rd   r   r   Úinnerñ  s    z*config_prefix.<locals>.wrap.<locals>.inner)r	   r
   )rv   r¿   ©rd   )rv   r   r¨   ð  s    zconfig_prefix.<locals>.wrapN)r•   Ú
get_optionÚ
set_option)rd   r¨   Z_register_optionr:   rN   r   rÀ   r   Úconfig_prefixÒ  s    þrÃ   z	type[Any]zCallable[[Any], None])Ú_typer-   c                   s   ddœ‡ fd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`

    r;   r<   c                   s    t | ƒˆ krtdˆ › d�ƒ‚d S )NzValue must have type 'rž   )Útyper@   r¹   ©rÄ   r   r   r¿     s    zis_type_factory.<locals>.innerr   ©rÄ   r¿   r   rÆ   r   Úis_type_factory	  s    rÈ   c                   sL   t ˆ ttfƒr(tˆ ƒ‰ d ttˆ ƒ¡‰ndˆ › d�‰ddœ‡ ‡fd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ž   r;   r<   c                   s   t | ˆ ƒstdˆ› �ƒ‚d S )NzValue must be an instance of )rk   r@   r¹   ©rÄ   Z	type_reprr   r   r¿   1  s    
z"is_instance_factory.<locals>.inner)rk   ÚtuplerB   rX   Úmapr   rÇ   r   rÊ   r   Úis_instance_factory  s    rÍ   c                   s4   dd„ ˆD ƒ‰ dd„ ˆD ƒ‰ddœ‡ ‡fdd„}|S )Nc                 S  s   g | ]}t |ƒr|‘qS r   ©Úcallable©rU   Úcr   r   r   rV   :  rW   z%is_one_of_factory.<locals>.<listcomp>c                 S  s   g | ]}t |ƒs|‘qS r   rÎ   rÐ   r   r   r   rV   ;  rW   r;   r<   c                   s\   ˆ ˆvrXt ‡ fdd„ˆD ƒƒsXdd„ ˆD ƒ}d |¡}d|› �}tˆƒrP|d7 }t|ƒ‚d S )Nc                 3  s   | ]}|ˆ ƒV  qd S r6   r   rÐ   r¹   r   r   Ú	<genexpr>@  rW   z3is_one_of_factory.<locals>.inner.<locals>.<genexpr>c                 S  s   g | ]}t |ƒ‘qS r   )r   )rU   Zlvalr   r   r   rV   A  rW   z4is_one_of_factory.<locals>.inner.<locals>.<listcomp>rÉ   zValue must be one of z or a callable)ÚanyrX   r0   r@   )r¶   ZuvalsZ	pp_valuesr   ©Z	callablesÚlegal_valuesr¹   r   r¿   =  s    

z is_one_of_factory.<locals>.innerr   )rÕ   r¿   r   rÔ   r   Úis_one_of_factory8  s    rÖ   )Úvaluer-   c                 C  s2   | du rdS t | tƒr"| dkr"dS d}t|ƒ‚dS )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)rk   Úintr@   )r×   r   r   r   r   Úis_nonnegative_intK  s    
rÙ   c                 C  s   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Ï   r@   )Úobjr   r   r   Úis_callablem  s    rÛ   )F)rO   T)F)rO   NN)NNN)r¥   F)Gr)   Ú
__future__r   Ú
contextlibr   r   rŒ   Útypingr   r   r   r   r	   rF   Zpandas._typingr
   r   r   r!   r   r"   r$   r'   ÚAttributeErrorrn   r(   r5   r:   rN   r[   r^   ra   rb   rs   Z_get_option_tmplZ_set_option_tmplZ_describe_option_tmplZ_reset_option_tmplrÁ   rÂ   Zreset_optionZdescribe_optionÚoptionsr~   r•   r–   r/   r7   rš   rœ   rE   r3   r1   rS   r{   rÃ   rÈ   rÍ   rÖ   rÙ   rØ   Zis_intr*   Zis_boolÚfloatZis_floatr   Zis_strÚbytesZis_textrÛ   r   r   r   r   Ú<module>   sx   2	 . "  



#   ûM   ü3&
6