Yfo*6@sdZddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6g6Zd7d8lmZd9d&Zd:d#Zd;d Zd<d+Zd=d Z d>d Z d?d-Z d@d5Z dAdZ dBdZdCdZdDdZdEdZdFd ZdGdZdHdZeZdId%ZdJd)ZdKd*ZdLd'ZdMd,ZdNd.ZdOd/ZdPd0ZdQd1ZdRd3ZdSd4ZdTd6Z dUdZ!dVdZ"dWdZ#dXdZ$dYd Z%dZdZ&d[d2Z'd7d\d$Z(Gd]ddZ)Gd^d d Z*Gd_d(d(Z+d`dZ,dadZ-dbdZ.dcdZ/dddZ0dedZ1dfdZ2dgdZ3dhdZ4didZ5djdZ6dkdZ7dld!Z8dmd"Z9yd7dnl:TWne;k rzYnXd7dol:mZeZ<eZ=eZ>eZ?e Z@e ZAe ZBeZCeZDeZEeZFeZGeZHeZIeZJeZKeZLeZMeZNeZOeZPeZQeZReZSeZTe ZUe!ZVe"ZWe$ZXe%ZYe'ZZe,Z[e-Z\e.Z]e/Z^e0Z_e1Z`e2Zae3Zbe4Zce5Zde6Zee7Zfe8Zge9ZhdpS)qas Operator Interface This module exports a set of functions corresponding to the intrinsic operators of Python. For example, operator.add(x, y) is equivalent to the expression x+y. The function names are those used for special methods; variants without leading and trailing '__' are also provided for convenience. This is the pure Python implementation of the module. absaddand_ attrgetterconcatcontainscountOfdelitemeqfloordivgegetitemgtiaddiandiconcat ifloordivilshiftimatmulimodimulindexindexOfinvinvertioripowirshiftis_is_notisub itemgetteritruedivixorle length_hintlshiftltmatmul methodcallermodmulnenegnot_or_pospowrshiftsetitemsubtruedivtruthxor)rcCs ||kS)zSame as a < b.)abr8r8-/opt/alt/python35/lib64/python3.5/operator.pyr&scCs ||kS)zSame as a <= b.r8)r9r:r8r8r;r#scCs ||kS)zSame as a == b.r8)r9r:r8r8r;r #scCs ||kS)zSame as a != b.r8)r9r:r8r8r;r+'scCs ||kS)zSame as a >= b.r8)r9r:r8r8r;r +scCs ||kS)zSame as a > b.r8)r9r:r8r8r;r /scCs| S)zSame as not a.r8)r9r8r8r;r-5scCs|r dSdS)z*Return True if a is true, False otherwise.TFr8)r9r8r8r;r59scCs ||kS)zSame as a is b.r8)r9r:r8r8r;r=scCs ||k S)zSame as a is not b.r8)r9r:r8r8r;rAscCs t|S)zSame as abs(a).)_abs)r9r8r8r;rGscCs||S)zSame as a + b.r8)r9r:r8r8r;rKscCs||@S)zSame as a & b.r8)r9r:r8r8r;rOscCs||S)zSame as a // b.r8)r9r:r8r8r;r SscCs |jS)zSame as a.__index__().) __index__)r9r8r8r;rWscCs|S)z Same as ~a.r8)r9r8r8r;r[scCs||>S)zSame as a << b.r8)r9r:r8r8r;r%`scCs||S)zSame as a % b.r8)r9r:r8r8r;r)dscCs||S)zSame as a * b.r8)r9r:r8r8r;r*hscCs||S)zSame as a @ b.r8)r9r:r8r8r;r'lscCs| S)z Same as -a.r8)r9r8r8r;r,pscCs||BS)zSame as a | b.r8)r9r:r8r8r;r.tscCs| S)z Same as +a.r8)r9r8r8r;r/xscCs||S)zSame as a ** b.r8)r9r:r8r8r;r0|scCs||?S)zSame as a >> b.r8)r9r:r8r8r;r1scCs||S)zSame as a - b.r8)r9r:r8r8r;r3scCs||S)zSame as a / b.r8)r9r:r8r8r;r4scCs||AS)zSame as a ^ b.r8)r9r:r8r8r;r6scCs6t|ds.dt|j}t|||S)z%Same as a + b, for a and b sequences. __getitem__z!'%s' object can't be concatenated)hasattrtype__name__ TypeError)r9r:msgr8r8r;rs cCs ||kS)z(Same as b in a (note reversed operands).r8)r9r:r8r8r;rscCs1d}x$|D]}||kr |d7}q W|S)z)Return the number of times b occurs in a.r7r8)r9r:countir8r8r;rs   cCs ||=dS)zSame as del a[b].Nr8)r9r:r8r8r;rscCs||S)z Same as a[b].r8)r9r:r8r8r;r scCs=x6t|D]\}}||kr |Sq WtddS)z!Return the first index of b in a.z$sequence.index(x): x not in sequenceN) enumerate ValueError)r9r:rFjr8r8r;rs cCs|||= 0. z/'%s' object cannot be interpreted as an integerz'__length_hint__ must be integer, not %sr7z$__length_hint__() should return >= 0) isinstanceintr@rArBlen__length_hint__AttributeErrorNotImplementedrH)objdefaultrCZhintvalr8r8r;r$s4           c@sLeZdZdZd ZddZddZdd Zd d Zd S)raV Return a callable object that fetches the given attribute(s) from its operand. After f = attrgetter('name'), the call f(r) returns r.name. After g = attrgetter('name', 'date'), the call g(r) returns (r.name, r.date). After h = attrgetter('name.first', 'name.last'), the call h(r) returns (r.name.first, r.name.last). _attrs_callcs|sZt|ts!td|f|_|jdfdd}||_nC|f||_ttt|jfdd}||_dS)Nzattribute name must be a string.cs$xD]}t||}qW|S)N)getattr)rQname)namesr8r;funcs z!attrgetter.__init__..funccstfddDS)Nc3s|]}|VqdS)Nr8).0getter)rQr8r; sz4attrgetter.__init__..func..)tuple)rQ)getters)rQr;rZs) rKstrrBrTsplitrUr^mapr)selfattrZattrsrZr8)r_rYr;__init__s   zattrgetter.__init__cCs |j|S)N)rU)rcrQr8r8r;__call__szattrgetter.__call__cCs2d|jj|jjdjtt|jfS)Nz %s.%s(%s)z, ) __class__ __module__ __qualname__joinrbreprrT)rcr8r8r;__repr__s  zattrgetter.__repr__cCs|j|jfS)N)rgrT)rcr8r8r; __reduce__szattrgetter.__reduce__N)rTrU) rArhri__doc__ __slots__rerfrlrmr8r8r8r;rs    c@sLeZdZdZd ZddZddZdd Zd d Zd S)r z Return a callable object that fetches the given item(s) from its operand. After f = itemgetter(2), the call f(r) returns r[2]. After g = itemgetter(2, 5, 3), the call g(r) returns (r[2], r[5], r[3]) _itemsrUcscs0f|_fdd}||_n/f|_fdd}||_dS)Ncs|S)Nr8)rQ)itemr8r;rZsz!itemgetter.__init__..funccstfddDS)Nc3s|]}|VqdS)Nr8)r[rF)rQr8r;r]sz4itemgetter.__init__..func..)r^)rQ)items)rQr;rZs)rprU)rcrqrrrZr8)rqrrr;res  zitemgetter.__init__cCs |j|S)N)rU)rcrQr8r8r;rfszitemgetter.__call__cCs2d|jj|jjdjtt|jfS)Nz %s.%s(%s)z, )rgrhrArjrbrkrp)rcr8r8r;rl s  zitemgetter.__repr__cCs|j|jfS)N)rgrp)rcr8r8r;rm%szitemgetter.__reduce__N)rprU) rArhrirnrorerfrlrmr8r8r8r;r s   c@sLeZdZdZdZddZddZd d Zd d Zd S)r(z Return a callable object that calls the given method on its operand. After f = methodcaller('name'), the call f(r) returns r.name(). After g = methodcaller('name', 'date', foo=1), the call g(r) returns r.name('date', foo=1). _name_args_kwargscOsyt|dkr$d}t||d}|d|_t|jtsYtd|dd|_||_dS)Nz9methodcaller needs at least one argument, the method namer7rDzmethod name must be a string)rMrBrsrKr`rtru)argskwargsrCrcr8r8r;re1s    zmethodcaller.__init__cCst||j|j|jS)N)rWrsrtru)rcrQr8r8r;rf<szmethodcaller.__call__cCstt|jg}|jtt|j|jdd|jjDd|jj|jj dj |fS)Ncss%|]\}}d||fVqdS)z%s=%rNr8)r[kvr8r8r;r]Bsz(methodcaller.__repr__..z %s.%s(%s)z, ) rkrsextendrbrtrurrrgrhrArj)rcrwr8r8r;rl?s #  zmethodcaller.__repr__cCsY|js#|j|jf|jfSddlm}||j|j|j|jfSdS)Nr7)partial)rurgrsrt functoolsr|)rcr|r8r8r;rmGs zmethodcaller.__reduce__N)rsrtru) rArhrirnrorerfrlrmr8r8r8r;r((s   cCs||7}|S)zSame as a += b.r8)r9r:r8r8r;rQs cCs||M}|S)zSame as a &= b.r8)r9r:r8r8r;rVs cCs<t|ds.dt|j}t|||7}|S)z&Same as a += b, for a and b sequences.r>z!'%s' object can't be concatenated)r?r@rArB)r9r:rCr8r8r;r[s   cCs||}|S)zSame as a //= b.r8)r9r:r8r8r;rcs cCs||K}|S)zSame as a <<= b.r8)r9r:r8r8r;rhs cCs||;}|S)zSame as a %= b.r8)r9r:r8r8r;rms cCs||9}|S)zSame as a *= b.r8)r9r:r8r8r;rrs cCs||}|S)zSame as a @= b.r8)r9r:r8r8r;rws cCs||O}|S)zSame as a |= b.r8)r9r:r8r8r;r|s cCs||C}|S)zSame as a **= b.r8)r9r:r8r8r;rs cCs||L}|S)zSame as a >>= b.r8)r9r:r8r8r;rs cCs||8}|S)zSame as a -= b.r8)r9r:r8r8r;rs cCs||}|S)zSame as a /= b.r8)r9r:r8r8r;r!s cCs||N}|S)zSame as a ^= b.r8)r9r:r8r8r;r"s )*)rnN)irn__all__builtinsrr<r&r#r r+r r r-r5rrrrr rrrr%r)r*r'r,r.r/r0r1r3r4r6rrrrr rr2r$rr r(rrrrrrrrrrrrr!r" _operator ImportError__lt____le____eq____ne____ge____gt____not____abs____add____and__ __floordiv__r=__inv__ __invert__ __lshift____mod____mul__ __matmul____neg____or____pos____pow__ __rshift____sub__ __truediv____xor__ __concat__ __contains__ __delitem__r> __setitem____iadd____iand__ __iconcat__ __ifloordiv__ __ilshift____imod____imul__ __imatmul____ior____ipow__ __irshift____isub__ __itruediv____ixor__r8r8r8r; s                                   )')