Files
old-parkingkoncept/parkingkonceptvenv/lib/python3.7/site-packages/__pycache__/cycler.cpython-37.pyc

326 lines
16 KiB
Plaintext
Raw Normal View History

2019-11-17 12:44:16 +01:00
B
U<>]W><00>@s<>dZddlmZmZmZmZddlZddlmZm Z ddl
m Z m Z ddl mZmZddlZdZdd <09>ZGd
d <0B>d e<13>Zd d <0A>Zdd<0F>Zdd<11>ZdS)a<>
Cycler
======
Cycling through combinations of values, producing dictionaries.
You can add cyclers::
from cycler import cycler
cc = (cycler(color=list('rgb')) +
cycler(linestyle=['-', '--', '-.']))
for d in cc:
print(d)
Results in::
{'color': 'r', 'linestyle': '-'}
{'color': 'g', 'linestyle': '--'}
{'color': 'b', 'linestyle': '-.'}
You can multiply cyclers::
from cycler import cycler
cc = (cycler(color=list('rgb')) *
cycler(linestyle=['-', '--', '-.']))
for d in cc:
print(d)
Results in::
{'color': 'r', 'linestyle': '-'}
{'color': 'r', 'linestyle': '--'}
{'color': 'r', 'linestyle': '-.'}
{'color': 'g', 'linestyle': '-'}
{'color': 'g', 'linestyle': '--'}
{'color': 'g', 'linestyle': '-.'}
{'color': 'b', 'linestyle': '-'}
{'color': 'b', 'linestyle': '--'}
{'color': 'b', 'linestyle': '-.'}
<EFBFBD>)<04>absolute_import<72>division<6F>print_function<6F>unicode_literalsN)<02>product<63>cycle)<02>zip<69>reduce)<02>mul<75>addz0.10.0cCs`|dk rtt|<00><01>ni}|dk r,tt|<01><01>ni}t|<02><03><00>}t|<03><03><00>}||@rXtd<02><01>||BS)a
Helper function to compose cycler keys
Parameters
----------
left, right : iterable of dictionaries or None
The cyclers to be composed
Returns
-------
keys : set
The keys in the composition of the two cyclers
Nz"Can not compose overlapping cycles)<05>next<78>iter<65>set<65>keys<79>
ValueError)<06>left<66>rightZl_peekZr_peekZl_keyZr_key<65>r<00>*/tmp/pip-install-i8dhxrtk/cycler/cycler.py<70> _process_keys7s   rc@s<>eZdZdZdd<03>Zd+dd<06>Zedd<08><00>Zd d
<EFBFBD>Zd d <0C>Z e
d d<0E><00>Z dd<10>Z dd<12>Z dd<14>Zdd<16>Zdd<18>Zdd<1A>Zdd<1C>Zdd<1E>Zdd <20>Zd!d"<22>Zd#d$<24>Zd%d&<26>ZeZd'd(<28>Zd)d*<2A>ZdS),<2C>Cyclera
Composable cycles
This class has compositions methods:
``+``
for 'inner' products (zip)
``+=``
in-place ``+``
``*``
for outer products (itertools.product) and integer multiplication
``*=``
in-place ``*``
and supports basic slicing via ``[]``
Parameters
----------
left : Cycler or None
The 'left' cycler
right : Cycler or None
The 'right' cycler
op : func or None
Function which composes the 'left' and 'right' cyclers.
cCst|<00>S)N)r)<01>selfrrr<00>__call__mszCycler.__call__NcCs<>t|t<01>r t|j|j|j<04>|_n |dk r:dd<03>|D<00>|_nd|_t|t<01>r`t|j|j|j<04>|_n |dk rzdd<03>|D<00>|_nd|_t|j|j<03>|_||_dS)z\Semi-private init
Do not use this directly, use `cycler` function instead.
NcSsg|]}t<00>|<01><01>qSr)<01>copy)<02>.0<EFBFBD>vrrr<00>
<listcomp>zsz#Cycler.__init__.<locals>.<listcomp>cSsg|]}t<00>|<01><01>qSr)r)rrrrrr<00>s)<07>
isinstancer<00>_left<66>_right<68>_opr<00>_keys)rrr<00>oprrr<00>__init__ps

zCycler.__init__cCs
t|j<01>S)z2
The keys this Cycler knows about
)rr!)rrrrr<00>sz Cycler.keyscs<><00><01>kr dS<00>|jkr(td<02><01><00>f<00><01><01>|jkrDtd<03><01><00>f<00><01>|j<00><03><01>|j<00><04><00>|jdk r<><72>|jjkr<>|j<05><07><01><00>n4t|j t
<EFBFBD>r<>|j <09><07><01><00>n<18><00>fdd<05>|j D<00>|_ dS)a
Change a key in this cycler to a new name.
Modification is performed in-place.
Does nothing if the old key is the same as the new key.
Raises a ValueError if the new key is already a key.
Raises a KeyError if the old key isn't a key.
Nz-Can't replace %s with %s, %s is already a keyz)Can't replace %s with %s, %s is not a keycsg|]}<01>|<01>i<01>qSrr)r<00>entry)<02>new<65>oldrrr<00>sz%Cycler.change_key.<locals>.<listcomp>) r!r<00>KeyError<6F>remover rr<00>
change_keyrrr)rr&r%r)r%r&rr)<00>s


   zCycler.change_keyccsBx<|<00>|j|j<02>D](\}}t<03>}|<03>|<01>|<03>|<02>|VqWdS)z<>
Compose the 'left' and 'right' components of this cycle
with the proper operation (zip or product as of now)
N)r rr<00>dict<63>update)r<00>a<>b<>outrrr<00>_compose<73>s


zCycler._composecs0|d<01>}t<00>fdd<03>|D<00><01>|_t<02>g<01>|_|S)a<>
Class method to create 'base' Cycler objects
that do not have a 'right' or 'op' and for which
the 'left' object is not another Cycler.
Parameters
----------
label : str
The property key.
itr : iterable
Finite length iterable of the property values.
Returns
-------
cycler : Cycler
New 'base' `Cycler`
Nc3s|]}<01>|iVqdS)Nr)rr)<01>labelrr<00> <genexpr><3E>sz$Cycler._from_iter.<locals>.<genexpr>)<04>listrrr!)<04>clsr0<00>itr<74>retr)r0r<00>
_from_iter<EFBFBD>s zCycler._from_itercs<t<00>t<01>r0|<00><02>}tt<04>fdd<02>t<05>|<02>D<00><01>Std<03><01>dS)Nc3s |]\}}t||<02><00>VqdS)N)<01>_cycler)r<00>kr)<01>keyrrr1<00>sz%Cycler.__getitem__.<locals>.<genexpr>z+Can only use slices with Cycler.__getitem__)r<00>slice<63>by_keyr r <00>six<69> iteritemsr)rr9<00>transr)r9r<00> __getitem__<5F>s

zCycler.__getitem__cCs&|jdkrtdd<02>|jD<00><01>S|<00><03>S)Ncss|]}t|<01>VqdS)N)r*)r<00>lrrrr1<00>sz"Cycler.__iter__.<locals>.<genexpr>)rr rr/)rrrr<00>__iter__<5F>s
zCycler.__iter__cCs4t|<00>t|<01>kr(td<01>t|<00>t|<01><01><02><01>t||t<04>S)z<>
Pair-wise combine two equal length cycles (zip)
Parameters
----------
other : Cycler
The second Cycler
z1Can only add equal length cycles, not {0} and {1})<05>lenr<00>formatrr)r<00>otherrrr<00>__add__<5F>s zCycler.__add__csNt<00>t<01>rt|<00>t<02>St<00>t<03>rF|<00><04>}tt<06>fdd<02>t<07>|<02>D<00><01>St SdS)z<>
Outer product of two cycles (`itertools.product`) or integer
multiplication.
Parameters
----------
other : Cycler or int
The second Cycler or integer
c3s |]\}}t||<02><00>VqdS)N)r7)rr8r)rDrrr1sz!Cycler.__mul__.<locals>.<genexpr>N)
rrr<00>intr;r r r<r=<00>NotImplemented)rrDr>r)rDr<00>__mul__<5F>s
 
zCycler.__mul__cCs||S)Nr)rrDrrr<00>__rmul__szCycler.__rmul__cCsDtttti}|jdkr t|j<06>St|j<06>}t|j<04>}||j||<03>S)N)r<00>minrr
rrBrr )rZop_dictZl_lenZr_lenrrr<00>__len__ s  



zCycler.__len__cCsLt|t<01>std<01><01>t<03>|<00>}t||<01>|_||_t|_t|j|j |j<08>|_ |S)z<>
In-place pair-wise combine two equal length cycles (zip)
Parameters
----------
other : Cycler
The second Cycler
z"Cannot += with a non-Cycler object)
rr<00> TypeErrorrrr!rrr r)rrD<00>old_selfrrr<00>__iadd__s

 zCycler.__iadd__cCsLt|t<01>std<01><01>t<03>|<00>}t||<01>|_||_t|_t|j|j |j<08>|_ |S)z<>
In-place outer product of two cycles (`itertools.product`)
Parameters
----------
other : Cycler
The second Cycler
z"Cannot *= with a non-Cycler object)
rrrLrrr!rrr r)rrDrMrrr<00>__imul__&s

 zCycler.__imul__cCs<t|<00>t|<01>krdS|j|jAr$dStdd<03>t||<01>D<00><01>S)z
Check equality
Fcss|]\}}||kVqdS)Nr)rr,r-rrrr1Bsz Cycler.__eq__.<locals>.<genexpr>)rBr<00>allr)rrDrrr<00>__eq__9s
 z Cycler.__eq__csntdtdi}|jdkrD|j<03><04><00>t<05>fdd<04>|D<00><01>}dj<06>|d<06>S|<01>|jd<07>}d}|j|j ||jd <09>SdS)
N<EFBFBD>+<2B>*c3s|]}|<01>VqdS)Nr)rr)<01>labrrr1Hsz"Cycler.__repr__.<locals>.<genexpr>zcycler({lab!r}, {itr!r}))rTr4<00>?z({left!r} {op} {right!r}))rr"r)
rrrr<00>popr2rC<00>getr r)rZop_mapr4r"<00>msgr)rTr<00>__repr__Ds 

zCycler.__repr__cCs<>d}t|jtd<02>}x|D]}|dj|d<02>7}qWxBt|<00>D]6}|d7}x |D]}|dj||d<06>7}qLW|d7}q:W|d7}|S) Nz<table>)r9z<th>{key!r}</th>z<tr>z<td>{val!r}</td>)<01>valz</tr>z</table>)<05>sortedr<00>reprrCr )r<00>outputZ sorted_keysr9<00>dr8rrr<00> _repr_html_Os

 zCycler._repr_html_cCsJ|j}tdd<02>|D<00><01>}x,|D]$}x|D]}||<00>||<00>q(WqW|S)a<>Values by key
This returns the transposed values of the cycler. Iterating
over a `Cycler` yields dicts with a single value for each key,
this method returns a `dict` of `list` which are the values
for the given key.
The returned value can be used to create an equivalent `Cycler`
using only `+`.
Returns
-------
transpose : dict
dict of lists of the values for each key.
css|]}|t<00>fVqdS)N)r2)rr8rrrr1ssz Cycler.by_key.<locals>.<genexpr>)rr*<00>append)rrr.r^r8rrrr;]s 

z Cycler.by_keycCs"|<00><00>}ttdd<02>t<03>|<01>D<00><01>S)z<>Simplify the Cycler
Returned as a composition using only sums (no multiplications)
Returns
-------
simple : Cycler
An equivalent cycler using only summationcss|]\}}t||<02>VqdS)N)r7)rr8rrrrr1<00>sz"Cycler.simplify.<locals>.<genexpr>)r;r r r<r=)rr>rrr<00>simplify}szCycler.simplifycCs
t||<01>S)aFConcatenate this cycler and an other.
The keys must match exactly.
This returns a single Cycler which is equivalent to
`itertools.chain(self, other)`
Examples
--------
>>> num = cycler('a', range(3))
>>> let = cycler('a', 'abc')
>>> num.concat(let)
cycler('a', [0, 1, 2, 'a', 'b', 'c'])
Parameters
----------
other : `Cycler`
The `Cycler` to concatenate to this one.
Returns
-------
ret : `Cycler`
The concatenated `Cycler`
)<01>concat)rrDrrrrb<00>sz Cycler.concat)NN)<1B>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__doc__rr#<00>propertyrr)r/<00> classmethodr6r?rArErHrIrKrNrOrQrYr_r;Z
_transposerarbrrrrrMs,
 #    rcsj|j|jkr>d<01>dddg<03>j|j|j@|j|jAd<05>}t|<02><01>|<00><04><00>|<01><04><00>tt<06><00>fdd<07>|jD<00><01>S)a<>Concatenate two cyclers.
The keys must match exactly.
This returns a single Cycler which is equivalent to
`itertools.chain(left, right)`
Examples
--------
>>> num = cycler('a', range(3))
>>> let = cycler('a', 'abc')
>>> num.concat(let)
cycler('a', [0, 1, 2, 'a', 'b', 'c'])
Parameters
----------
left, right : `Cycler`
The two `Cycler` instances to concatenate
Returns
-------
ret : `Cycler`
The concatenated `Cycler`
z
zKeys do not match:zIntersection: {both!r}zDisjoint: {just_one!r})ZbothZjust_onec3s$|]}t|<01>|<00>|<00>VqdS)N)r7)rr8)<02>_l<5F>_rrrr1<00>szconcat.<locals>.<genexpr>)r<00>joinrCrr;r r )rrrXr)rirjrrb<00>s 
rbcOs<>|r|rtd<01><01>t|<00>dkr>t|dt<03>s2td<04><01>t|d<00>St|<00>dkrRt|<00>St|<00>dkrftd<06><01>|r<>ttdd<08>t<07>|<01>D<00><01>Std <09><01>d
S) a<>
Create a new `Cycler` object from a single positional argument,
a pair of positional arguments, or the combination of keyword arguments.
cycler(arg)
cycler(label1=itr1[, label2=iter2[, ...]])
cycler(label, itr)
Form 1 simply copies a given `Cycler` object.
Form 2 composes a `Cycler` as an inner product of the
pairs of keyword arguments. In other words, all of the
iterables are cycled simultaneously, as if through zip().
Form 3 creates a `Cycler` from a label and an iterable.
This is useful for when the label cannot be a keyword argument
(e.g., an integer or a name that has a space in it).
Parameters
----------
arg : Cycler
Copy constructor for Cycler (does a shallow copy of iterables).
label : name
The property key. In the 2-arg form of the function,
the label can be any hashable object. In the keyword argument
form of the function, it must be a valid python identifier.
itr : iterable
Finite length iterable of the property values.
Can be a single-property `Cycler` that would
be like a key change, but as a shallow copy.
Returns
-------
cycler : Cycler
New `Cycler` for the given property
zBcyl() can only accept positional OR keyword arguments -- not both.<2E>rzEIf only one positional argument given, it must be a Cycler instance.<2E>zdOnly a single Cycler can be accepted as the lone positional argument. Use keyword arguments instead.css|]\}}t||<02>VqdS)N)r7)rr8rrrrr1 szcycler.<locals>.<genexpr>z4Must have at least a positional OR keyword argumentsN) rLrBrrr7r r r<r=)<02>args<67>kwargsrrr<00>cycler<65>s(    rpcsNt|t<01>rB|j}t|<02>dkr(d}t|<03><01>|<02><05><00><00>fdd<04>|D<00>}t<01>||<01>S)aI
Create a new `Cycler` object from a property name and
iterable of values.
Parameters
----------
label : hashable
The property key.
itr : iterable
Finite length iterable of the property values.
Returns
-------
cycler : Cycler
New `Cycler` for the given property
rlz2Can not create Cycler from a multi-property Cyclerc3s|]}|<01>VqdS)Nr)rr)rTrrr1,sz_cycler.<locals>.<genexpr>)rrrrBrrVr6)r0r4rrXr)rTrr7s
 r7)rf<00>
__future__rrrrr<<00> itertoolsrrZ six.movesrr <00>operatorr
r r<00> __version__r<00>objectrrbrpr7rrrr<00><module>)sa(=