Files
old-saburly-wagtail-web/env/lib/python3.10/site-packages/treebeard/__pycache__/numconv.cpython-310.pyc

52 lines
3.7 KiB
Plaintext
Raw Normal View History

2024-08-27 20:33:44 +02:00
o
<00><><EFBFBD>fK<00>@sxdZdZdZedd<04>ZdZedd<06>ZdZedd<08>d Zedd<08>ZGd
d <0B>d e <09>Z
d efd d<0E>Z d efdd<10>Z dS)zeConvert strings to numbers and numbers to strings.
Gustavo Picon
https://tabo.pe/projects/numconv/
z2.1.1zU0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~N<><00> ABCDEFGHIJKLMNOPQRSTUVWXYZ234567<36> z@ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/<2F>>z-_c@s.eZdZdZdefdd<04>Zdd<06>Zdd<08>Zd S)
<EFBFBD>NumConvaeClass to create converter objects.
:param radix: The base that will be used in the conversions.
The default value is 10 for decimal conversions.
:param alphabet: A string that will be used as a encoding alphabet.
The length of the alphabet can be longer than the radix. In this
case the alphabet will be internally truncated.
The default value is :data:`numconv.BASE85`
:raise TypeError: when *radix* isn't an integer
:raise ValueError: when *radix* is invalid
:raise ValueError: when *alphabet* has duplicated characters
<20>
cCs<>t|<01>|kr
td<01><01>d|krt|<02>ks ntdt|<02>f<00><01>||_||_tt|jtt|j<05><01><01><02>|_ t|j <09>t|j<05>krFtd|jf<00><01>dS)z'basic validation and cached_map storagezradix must be an integer<65>zradix must be >= 2 and <= %dz"duplicate characters found in '%s'N)
<EFBFBD>int<6E> TypeError<6F>len<65>
ValueError<EFBFBD>radix<69>alphabet<65>dict<63>zip<69>range<67>
cached_map)<03>selfr r <00>r<00>S/home/amir/Desktop/saburlyweb/env/lib/python3.10/site-packages/treebeard/numconv.py<70>__init__*s <08><08><04>zNumConv.__init__cCs<>t|<01>|kr
td<01><01>|dkrtd<03><01>|j|j}}|dvr9|d|<02><00><05>td|<02><00><05>kr9dddd<04>||<00><07>Sd } ||||}||krK |S||}q<)
aConverts an integer into a string.
:param num: A numeric value to be converted to another base as a
string.
:rtype: string
:raise TypeError: when *num* isn't an integer
:raise ValueError: when *num* isn't positive
znumber must be an integer<65>znumber must be positive)<03>rrNz%oz%dz%x<>)rr r r r <00>lower<65>BASE85<38>upper)r<00>numr r <00>retrrr<00>int2str8s  <08><02>zNumConv.int2strcCs<>|j|j}}|dkr |d|<02><00><02>td|<02><00><02>kr t||<02>Sd}|d|<02>}|D]}||vr8td||f<00><01>|||j|}q*|S)aConverts a string into an integer.
If possible, the built-in python conversion will be used for speed
purposes.
:param num: A string that will be converted to an integer.
:rtype: integer
:raise ValueError: when *num* is invalid
<20>$Nrz3invalid literal for radix2int() with radix %d: '%s')r r rrrr r)rrr r r<00> lalphabet<65>charrrr<00>str2intSs (
 <06>zNumConv.str2intN)<08>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__doc__rrrr"rrrrrs
 rrcC<00>t||<02><02>|<00>S)zChelper function for quick base conversions from integers to strings)rr<00>rr r rrrrl<00>rcCr')zChelper function for quick base conversions from strings to integers)rr"r(rrrr"qr)r") r&<00> __version__r<00>BASE16<31>BASE32<33> BASE32HEX<45>BASE64<36> BASE64URL<52>BASE62<36>objectrrr"rrrr<00><module>s   R