zmc
2023-08-08 e792e9a60d958b93aef96050644f369feb25d61b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
U
¬ý°dÎcã@sUdZddlmZddlmZmZddlZddlmZm    Z    m
Z
m Z m Z m Z mZddlZddlmZmZddlmZGdd    „d    e ƒZGd
d „d e ƒZiZd ed <iZded<iZded<dgZded<Gdd„deeƒZddddœdd„Zdnddddœdd„Z d d!œd"d#„Z!doddd&d'œd(d)„Z"dpddd dœd*d+„Z#dd,œd-d.„Z$Gd/d0„d0ƒZ%Gd1d2„d2e eƒZ&d3Z'd4Z(d5Z)d6Z*e&e e'ƒa+e&e!e(ƒa,e&e#e*ƒZ-e&e"e)ƒZ.e%eƒZ/Gd7d8„d8eƒZ0dqdd9dd:d;d d<œd=d>„a1drdd&d&d&d d?œd@dA„Z2dddBœdCdD„Z3ddEdFœdGdH„Z4dddFœdIdJ„Z5ddKœdLdM„Z6ddKœdNdO„Z7dddFœdPdQ„Z8dddFœdRdS„Z9dddTœdUdV„Z:dsdXdYddZœd[d\„Z;ed]d!œd^d_„ƒZ<d`dadbœdcdd„Z=dad!œdedf„Z>dad!œdgdh„Z?d9d diœdjdk„Z@e=eAƒZBe=eCƒZDe=eEƒZFe=eGƒZHe>eGeIfƒZJdd!œdldm„ZKdS)taò
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Ú    GeneratorÚGenericÚIterableÚ
NamedTupleÚcast)ÚFÚT)Úfind_stack_levelc@s.eZdZUded<ded<ded<ded<dS)ÚDeprecatedOptionÚstrÚkeyú
str | NoneÚmsgÚrkeyÚ removal_verN©Ú__name__Ú
__module__Ú __qualname__Ú__annotations__©rrúLd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\pandas/_config/config.pyrLs
rc@s6eZdZUded<ded<ded<ded<ded    <d
S) ÚRegisteredOptionrrÚobjectÚdefvalÚdocúCallable[[object], Any] | NoneÚ    validatorúCallable[[str], Any] | NoneÚcbNrrrrrrSs
 
rzdict[str, DeprecatedOption]Ú_deprecated_optionszdict[str, RegisteredOption]Ú_registered_optionsúdict[str, Any]Ú_global_configÚallú    list[str]Ú_reserved_keysc@seZdZdZdS)Ú OptionErrorz^
    Exception raised for pandas.options.
 
    Backwards compatible with KeyError checks.
    N)rrrÚ__doc__rrrrr,hsr,rÚbool)ÚpatÚsilentÚreturncCsft|ƒ}t|ƒdkr2|s t|ƒtdt|ƒ›ƒ‚t|ƒdkrFtdƒ‚|d}|sZt|ƒt|ƒ}|S)NrzNo such keys(s): ézPattern matched multiple keys)Ú_select_optionsÚlenÚ_warn_if_deprecatedr,ÚreprÚ_translate_key)r/r0ÚkeysrrrrÚ_get_single_keyts  r9FrcCst||ƒ}t|ƒ\}}||S©N)r9Ú    _get_root)r/r0rÚrootÚkrrrÚ _get_option†s
 r>ÚNone©r1c
 
Osît|ƒ}|r|ddkr tdƒ‚| dd¡}|rPt| ¡ƒd}td|›dƒ‚t|ddd…|ddd…ƒD]z\}}t||ƒ}t|ƒ}|rœ|j    rœ|     |¡t
|ƒ\}    }||    |<|j rn|rÞt j d    d
|  |¡W5QRXqn|  |¡qndS) Nérz4Must provide an even number of non-keyword argumentsr0Fz2_set_option() got an unexpected keyword argument "ú"r2T)Úrecord)r4Ú
ValueErrorÚpopÚlistr8Ú    TypeErrorÚzipr9Ú_get_registered_optionr"r;r$ÚwarningsÚcatch_warnings)
ÚargsÚkwargsÚnargsr0Úkwargr=ÚvrÚor<rrrÚ _set_optionŽs& &
 
 
 rRÚTr)r/Ú _print_descr1cCsDt|ƒ}t|ƒdkrtdƒ‚d dd„|Dƒ¡}|r@t|ƒdS|S)NrúNo such keys(s)Ú
cSsg|] }t|ƒ‘qSr)Ú_build_option_description©Ú.0r=rrrÚ
<listcomp>³sz$_describe_option.<locals>.<listcomp>)r3r4r,ÚjoinÚprint)r/rTr8ÚsrrrÚ_describe_option®s r^cCsft|ƒ}t|ƒdkrtdƒ‚t|ƒdkrDt|ƒdkrD|dkrDtdƒ‚|D]}t|t|j|dqHdS)NrrUr2é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©r0)r3r4r,rDrRr&r)r/r0r8r=rrrÚ _reset_option»s  ÿra©r/cCst|dd}t|ƒjS©NTr`)r9rIr)r/rrrrÚget_default_valÌs rdc@sReZdZdZdddddœdd„Zdd    dd
œd d „Zdd œdd„Zddœdd„ZdS)Ú DictWrapperz/provide attribute-style access to a nested dictrSr'rr?)ÚdÚprefixr1cCs t |d|¡t |d|¡dS)Nrfrg)rÚ __setattr__)ÚselfrfrgrrrÚ__init__ÔszDictWrapper.__init__r)rÚvalr1cCsRt |d¡}|r|d7}||7}||jkrFt|j|tƒsFt||ƒntdƒ‚dS)NrgÚ.z.You can only set the value of existing options)rÚ__getattribute__rfÚ
isinstanceÚdictrRr,)rirrkrgrrrrhØs  zDictWrapper.__setattr__©rc
Cs‚t |d¡}|r|d7}||7}zt |d¡|}Wn,tk
r`}ztdƒ|‚W5d}~XYnXt|tƒrvt||ƒSt|ƒSdS)NrgrlrfzNo such option)rrmÚKeyErrorr,rnrorer>)rirrgrPÚerrrrrÚ __getattr__äs 
 
zDictWrapper.__getattr__ú Iterable[str]r@cCst|j ¡ƒSr:)rFrfr8)rirrrÚ__dir__òszDictWrapper.__dir__N)rS)rrrr-rjrhrsrurrrrreÑs
 rec@s>eZdZddddœdd„Zddœd    d
„Zeddœd d „ƒZd S)ÚCallableDynamicDoczCallable[..., T]rr?)ÚfuncÚdoc_tmplr1cCs||_||_dSr:)Ú __doc_tmpl__Ú__func__)rirwrxrrrrjszCallableDynamicDoc.__init__r r@cOs |j||ŽSr:)rz)rirLÚkwdsrrrÚ__call__szCallableDynamicDoc.__call__cCs,tddd}ttt ¡ƒƒ}|jj||dS)Nr)F)rT)Ú    opts_descÚ    opts_list)r^Úpp_options_listrFr&r8ryÚformat)rir}r~rrrr-s zCallableDynamicDoc.__doc__N)rrrrjr|Úpropertyr-rrrrrvÿsrvaƒ
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@s:eZdZdZddœdd„Zddœdd„Zddœdd    „Zd
S) Úoption_contextaF
    Context manager to temporarily set options in the `with` statement context.
 
    You need to invoke as ``option_context(pat, val, [(pat, val), ...])``.
 
    Examples
    --------
    >>> from pandas import option_context
    >>> with option_context('display.max_rows', 10, 'display.max_columns', 5):
    ...     pass
    r?r@cGsLt|ƒddkst|ƒdkr$tdƒ‚tt|ddd…|ddd…ƒƒ|_dS)NrArz>Need to invoke as option_context(pat, val, [(pat, val), ...]).r2)r4rDrFrHÚops)rirLrrrrj°s
ÿzoption_context.__init__cCs4dd„|jDƒ|_|jD]\}}t||ddqdS)NcSs g|]\}}|t|ddf‘qS)Tr`)r>)rYr/rkrrrrZ¹sz,option_context.__enter__.<locals>.<listcomp>Tr`)rƒÚundorR)rir/rkrrrÚ    __enter__¸szoption_context.__enter__cGs(|jr$|jD]\}}t||ddq dSrc)r„rR)rirLr/rkrrrÚ__exit__¾szoption_context.__exit__N)rrrr-rjr…r†rrrrr‚£s r‚rr!r#)rrr r"r$r1c CsVddl}ddl}| ¡}|tkr0td|›dƒ‚|tkrHtd|›dƒ‚|rT||ƒ| d¡}|D]@}t d|j    d|¡sŠt
|›d    ƒ‚|  |¡rbt
|›d
ƒ‚qbt }    d }
t |dd …ƒD]H\} } t|    tƒsìt|
jd |d| …¡d ƒ‚| |    krüi|    | <|    | }    q¼t|    tƒs0t|
jd |dd …¡d ƒ‚||    |d <t|||||dt|<dS)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.
 
    rNúOption 'z' has already been registeredz' is a reserved keyrlú^ú$z is not a valid identifierz is a python keywordz5Path prefix to option '{option}' is already an optionéÿÿÿÿ)Úoption)rrr r"r$)ÚkeywordÚtokenizeÚlowerr&r,r+ÚsplitÚreÚmatchÚNamerDÚ    iskeywordr(Ú    enumeraternror€r[r) rrr r"r$rŒrÚpathr=ÚcursorrÚiÚprrrÚregister_optionÄsB
 
 
 
  ÿr™)rrrrr1cCs6| ¡}|tkr td|›dƒ‚t||||ƒt|<dS)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)rrrrrrrÚdeprecate_options'rš)r/r1cs8ˆtkrˆgStt ¡ƒ}ˆdkr&|S‡fdd„|DƒS)zb
    returns a list of keys matching `pat`
 
    if pat=="all", returns all registered options
    r)cs g|]}t ˆ|tj¡r|‘qSr)rÚsearchÚIrXrbrrrZQsz#_select_options.<locals>.<listcomp>)r&Úsortedr8)r/r8rrbrr3Bs  r3ztuple[dict[str, Any], str])rr1cCs4| d¡}t}|dd…D] }||}q||dfS)NrlrŠ)rr()rr•r–r˜rrrr;Ts
 
 
r;cCs| ¡}|tkS)z4Returns True if the given option has been deprecated)rŽr%rprrrÚ_is_deprecated\sržrpcCs,z t|}Wntk
r"YdSX|SdS)z±
    Retrieves the metadata for a deprecated option, if `key` is deprecated.
 
    Returns
    -------
    DeprecatedOption (namedtuple) if key is deprecated, None otherwise
    N)r%rq©rrfrrrÚ_get_deprecated_optionbs
 r cCs
t |¡S)z¨
    Retrieves the option metadata if `key` is a registered option.
 
    Returns
    -------
    RegisteredOption (namedtuple) if key is deprecated, None otherwise
    )r&ÚgetrprrrrIrsrIcCst|ƒ}|r|jp|S|SdS)z‚
    if key id deprecated and a replacement key defined, will return the
    replacement key, otherwise returns `key` as - is
    N)r rrŸrrrr7}s
r7cCs†t|ƒ}|r‚|jr(tj|jttƒdnVd|›d}|jrJ|d|j›7}|jrd|d|j›d7}n|d7}tj|ttƒddSd    S)
    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 rrJÚwarnÚ FutureWarningrrr)rrfrrrrr5‰s"ý r5)r=r1cCs˜t|ƒ}t|ƒ}|›d}|jr<|d |j ¡ d¡¡7}n|d7}|rf|d|j›dt|dƒ›d7}|r”|jprd}|d    7}|d
|›d 7}|d 7}|S) zCBuilds a formatted description of a registered option and prints itú rVzNo description available.z
    [default: z] [currently: Tú]rSz
    (Deprecatedz, use `z
` instead.ú))    rIr r r[Ústriprrr>r)r=rQrfr]rrrrrW§s
 
rWéPrtÚint)r8ÚwidthÚ_printc
sÆddlm}ddlm‰ddddœ‡‡fdd    „ }g}d
d „t|ƒDƒ}|rX||d |ƒ7}d d „|Dƒ}|t|ƒdd„ƒD],\‰}‡fdd „t|ƒDƒ}||ˆ|ƒ7}qxd |¡}    |r¾t|    ƒn|    SdS)z@Builds a concise listing of available options, grouped by prefixr)Úgroupby)Úwraprrtr*)ÚnameÚksr1csP|rd|dnd}ˆd |¡ˆ|ddd}|rL|drL|rL|dd    |d<|S)
Nz- z.[rSz, z  F)Úinitial_indentÚsubsequent_indentÚbreak_long_wordsrŠr§)r[)r°r±ÚpfxÚls)r¬r¯rrÚppÄsûzpp_options_list.<locals>.ppcSsg|]}| d¡dkr|‘qS©rlr©Úfind©rYÚxrrrrZÒsz#pp_options_list.<locals>.<listcomp>rScSsg|]}| d¡dkr|‘qSr¸r¹r»rrrrZÕscSs|d| d¡…S©Nrl)Úrfind©r¼rrrÚ<lambda>×óz!pp_options_list.<locals>.<lambda>cs g|]}|tˆƒdd…‘qS)r2N)r4r»)r=rrrZØsrVN)Ú    itertoolsr®Útextwrapr¯rrFr[r\)
r8r¬r­r®r·r¶ZsinglesÚgr±r]r)r=r¬r¯rr¿s   
 
rzGenerator[(None, None, None)]c#sVdddœ‡fdd„ }t}t}t}|tƒa|tƒa|tƒaz
dVW5|a|a|aXdS)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 )rwr1csddœ‡‡fdd„ }tt|ƒS)Nrrpcsˆ›d|›}ˆ|f|ž|ŽSr½r)rrLr{Zpkey)rwrgrrÚinnersz*config_prefix.<locals>.wrap.<locals>.inner)r r )rwrÅ©rg)rwrr¯szconfig_prefix.<locals>.wrapN)r™Ú
get_optionÚ
set_option)rgr¯Z_register_optionr>rRrrÆrÚ config_prefixås
rÉz    type[Any]zCallable[[Any], None])Ú_typer1csddœ‡fdd„ }|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@cs t|ƒˆkrtdˆ›dƒ‚dS)NzValue must have type 'r£)ÚtyperDr¿©rÊrrrÅ*s zis_type_factory.<locals>.innerr©rÊrÅrrÌrÚis_type_factorysrÎcsLtˆttfƒr(tˆƒ‰d ttˆƒ¡‰n dˆ›d‰ddœ‡‡fdd„ }|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@cst|ˆƒstdˆ›ƒ‚dS)NzValue must be an instance of )rnrDr¿©rÊZ    type_reprrrrÅDs
z"is_instance_factory.<locals>.inner)rnÚtuplerFr[ÚmaprrÍrrÐrÚis_instance_factory1s  rÓcs4dd„ˆDƒ‰dd„ˆDƒ‰ddœ‡‡fdd„ }|S)NcSsg|]}t|ƒr|‘qSr©Úcallable©rYÚcrrrrZLsz%is_one_of_factory.<locals>.<listcomp>cSsg|]}t|ƒs|‘qSrrÔrÖrrrrZMsr?r@cs\ˆˆkrXt‡fdd„ˆDƒƒsXdd„ˆDƒ}d |¡}d|›}tˆƒrP|d7}t|ƒ‚dS)Nc3s|]}|ˆƒVqdSr:rrÖr¿rrÚ    <genexpr>Qsz3is_one_of_factory.<locals>.inner.<locals>.<genexpr>cSsg|] }t|ƒ‘qSr)r)rYZlvalrrrrZRsz4is_one_of_factory.<locals>.inner.<locals>.<listcomp>rÏzValue must be one of z or a callable)Úanyr[r4rD)r¼ZuvalsZ    pp_valuesr©Z    callablesÚ legal_valuesr¿rrÅOs
 
z is_one_of_factory.<locals>.innerr)rÛrÅrrÚrÚis_one_of_factoryKs
rÜ)Úvaluer1cCs2|dkr dSt|tƒr"|dkr"dSd}t|ƒ‚dS)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
    Nrz+Value must be a nonnegative integer or None)rnr«rD)rÝrrrrÚis_nonnegative_int\s
rÞcCst|ƒstdƒ‚dS)z»
 
    Parameters
    ----------
    `obj` - the object to be checked
 
    Returns
    -------
    validator - returns True if object is callable
        raises ValueError otherwise.
 
    zValue must be a callableT)rÕrD)ÚobjrrrÚ is_callable~s rà)F)rST)F)rSNN)NNN)rªF)Lr-Ú
__future__rÚ
contextlibrrrÚtypingrrrrr    r
r rJZpandas._typingr r Zpandas.util._exceptionsrrrr%rr&r(r+ÚAttributeErrorrqr,r9r>rRr^rardrervZ_get_option_tmplZ_set_option_tmplZ_describe_option_tmplZ_reset_option_tmplrÇrÈZ reset_optionZdescribe_optionÚoptionsr‚r™ršr3r;ržr rIr7r5rWrrÉrÎrÓrÜrÞr«Zis_intr.Zis_boolÚfloatZis_floatrZis_strÚbytesZis_textràrrrrÚ<module>sz2 $               ."$""
 
 
 
$ûMü3  &6