B /g^o*c6@s(dZddddddddd 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 Zdd 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'dqd\d$Z(Gd]ddZ)Gd^d d Z*Gd_d(d(Z+d`dZ,dadZ-dbdZ.dcdZ/dddZ0dedZ1dfdZ2dgdZ3dhdZ4didZ5djdZ6dkdZ7dld!Z8dmd"Z9y d7dnl:TWne;k rbYnXd7dol:mZeZeZ?e Z@e ZAe ZBeZCeZDeZEeZFeZGeZHeZIeZJeZKeZLeZMeZNeZOeZPeZQeZReZSeZTe ZUe!ZVe"ZWe$ZXe%ZYe'ZZe,Z[e-Z\e.Z]e/Z^e0Z_e1Z`e2Zae3Zbe4Zce5Zde6Zee7Zfe8Zge9ZhdpS)ras 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.abr7r7 /usr/lib64/python3.7/operator.pyr%cCs||kS)zSame as a <= b.r7r8r7r7r;r"r<cCs||kS)zSame as a == b.r7r8r7r7r;r#r<cCs||kS)zSame as a != b.r7r8r7r7r;r*'r<cCs||kS)zSame as a >= b.r7r8r7r7r;r +r<cCs||kS)zSame as a > b.r7r8r7r7r;r /r<cCs| S)zSame as not a.r7r9r7r7r;r,5r<cCs |rdSdS)z*Return True if a is true, False otherwise.TFr7r=r7r7r;r49r<cCs||kS)zSame as a is b.r7r8r7r7r;r=r<cCs||k S)zSame as a is not b.r7r8r7r7r;rAr<cCst|S)zSame as abs(a).)_absr=r7r7r;rGr<cCs||S)zSame as a + b.r7r8r7r7r;rKr<cCs||@S)zSame as a & b.r7r8r7r7r;rOr<cCs||S)zSame as a // b.r7r8r7r7r;r Sr<cCs|S)zSame as a.__index__().) __index__r=r7r7r;rWr<cCs|S)z Same as ~a.r7r=r7r7r;r[r<cCs||>S)zSame as a << b.r7r8r7r7r;r$`r<cCs||S)zSame as a % b.r7r8r7r7r;r(dr<cCs||S)zSame as a * b.r7r8r7r7r;r)hr<cCs||S)zSame as a @ b.r7r8r7r7r;r&lr<cCs| S)z Same as -a.r7r=r7r7r;r+pr<cCs||BS)zSame as a | b.r7r8r7r7r;r-tr<cCs| S)z Same as +a.r7r=r7r7r;r.xr<cCs||S)zSame as a ** b.r7r8r7r7r;r/|r<cCs||?S)zSame as a >> b.r7r8r7r7r;r0r<cCs||S)zSame as a - b.r7r8r7r7r;r2r<cCs||S)zSame as a / b.r7r8r7r7r;r3r<cCs||AS)zSame as a ^ b.r7r8r7r7r;r5r<cCs(t|ds dt|j}t|||S)z%Same as a + b, for a and b sequences. __getitem__!'%s' object can't be concatenatedZhasattrtype__name__ TypeErrorr9r:msgr7r7r;rs cCs||kS)z(Same as b in a (note reversed operands).r7r8r7r7r;rr<cCs&d}x|D]}||kr |d7}q W|S)z)Return the number of times b occurs in a.r6r7)r9r:Zcountir7r7r;rs   cCs ||=dS)zSame as del a[b].Nr7r8r7r7r;rr<cCs||S)z Same as a[b].r7r8r7r7r;r r<cCs.x(t|D]\}}||kr |Sq WtddS)z!Return the first index of b in a.z$sequence.index(x): x not in sequenceN)Z enumerate ValueError)r9r:rIZjr7r7r;rscCs |||<dS)zSame as a[b] = c.Nr7)r9r:Zcr7r7r;r1r<cCst|ts dt|j}t|yt|Stk r<YnXyt|j}Wntk r`|SXy ||}Wntk r|SX|tkr|St|tsdt|j}t||dkrd}t ||S)a2 Return an estimate of the number of items in obj. This is useful for presizing containers when building from an iterable. If the object supports len(), the result will be exact. Otherwise, it may over- or under-estimate by an arbitrary amount. The result will be an integer >= 0. z/'%s' object cannot be interpreted as an integerz'__length_hint__ must be integer, not %sr6z$__length_hint__() should return >= 0) isinstanceZintrCrDrElenZ__length_hint__ZAttributeErrorZNotImplementedrJ)objZdefaultrGZhintZvalr7r7r;r#s4     c@4eZdZdZdZddZddZddZd 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_callcsn|s.funcctfddDS)Nc3s|]}|VqdSrQr7).0ZgetterrMr7r; z4attrgetter.__init__..func..tuplerW)gettersrWr;rT) rKstrrErOZsplitrPr[mapr)selfZattrZattrsrTr7)r\rSr;__init__s     zattrgetter.__init__cC ||SrQrPr`rMr7r7r;__call__r]zattrgetter.__call__cC$d|jj|jjdtt|jfSN %s.%s(%s), ) __class__ __module__ __qualname__joinr_reprrOr`r7r7r;__repr__zattrgetter.__repr__cC |j|jfSrQ)rjrOror7r7r; __reduce__r]zattrgetter.__reduce__N rDrkrl__doc__Z __slots__rarerprsr7r7r7r;rs c@rN) rz 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]) _itemsrPcsFs f|_fdd}||_n"f|_fdd}||_dS)Ncs|SrQr7rW)itemr7r;rTr]z!itemgetter.__init__..funccrU)Nc3s|]}|VqdSrQr7)rVrIrWr7r;rXrYz4itemgetter.__init__..func..rZrW)itemsrWr;rTr]rv)r`rxryrTr7)rxryr;ras  zitemgetter.__init__cCrbrQrcrdr7r7r;rer]zitemgetter.__call__cCrfrg)rjrkrDrmr_rnrwror7r7r;rp rqzitemgetter.__repr__cCrrrQ)rjrwror7r7r;rs%r]zitemgetter.__reduce__Nrtr7r7r7r;r s  c@rN) 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_kwargscOsVt|dkrd}t||d}|d|_t|jts>td|dd|_||_dS)Niz9methodcaller needs at least one argument, the method namer6rHzmethod name must be a string)rLrErzrKr^r{r|)argsZkwargsrGr`r7r7r;ra1s   zmethodcaller.__init__cCst||j|j|jSrQ)rRrzr{r|rdr7r7r;re<r]zmethodcaller.__call__cCsTt|jg}|tt|j|dd|jDd|jj|jj d |fS)Ncss|]\}}d||fVqdS)z%s=%rNr7)rVZkZvr7r7r;rXBrYz(methodcaller.__repr__..rhri) rnrzZextendr_r{r|ryrjrkrDrm)r`r}r7r7r;rp?s  zmethodcaller.__repr__cCsD|js|j|jf|jfSddlm}||j|jf|j|jfSdS)Nr6)partial)r|rjrzr{Z functoolsr~)r`r~r7r7r;rsGs zmethodcaller.__reduce__Nrtr7r7r7r;r'(s  cCs ||7}|S)zSame as a += b.r7r8r7r7r;r QcCs ||M}|S)zSame as a &= b.r7r8r7r7r;rVrcCs,t|ds dt|j}t|||7}|S)z&Same as a += b, for a and b sequences.r@rArBrFr7r7r;r[s  cCs ||}|S)zSame as a //= b.r7r8r7r7r;rcrcCs ||K}|S)zSame as a <<= b.r7r8r7r7r;rhrcCs ||;}|S)zSame as a %= b.r7r8r7r7r;rmrcCs ||9}|S)zSame as a *= b.r7r8r7r7r;rrrcCs ||}|S)zSame as a @= b.r7r8r7r7r;rwrcCs ||O}|S)zSame as a |= b.r7r8r7r7r;r|rcCs ||C}|S)zSame as a **= b.r7r8r7r7r;rrcCs ||L}|S)zSame as a >>= b.r7r8r7r7r;rrcCs ||8}|S)zSame as a -= b.r7r8r7r7r;rrcCs ||}|S)zSame as a /= b.r7r8r7r7r;r rcCs ||N}|S)zSame as a ^= b.r7r8r7r7r;r!r)Z*)ruN)r6)iruZ__all__Zbuiltinsrr>r%r"rr*r r r,r4rrrrr rrrr$r(r)r&r+r-r.r/r0r2r3r5rrrrr rr1r#rrr'r rrrrrrrrrrrr r!Z _operatorZ ImportErrorZ__lt__Z__le__Z__eq__Z__ne__Z__ge__Z__gt__Z__not__Z__abs__Z__add__Z__and__Z __floordiv__r?Z__inv__Z __invert__Z __lshift__Z__mod__Z__mul__Z __matmul__Z__neg__Z__or__Z__pos__Z__pow__Z __rshift__Z__sub__Z __truediv__Z__xor__Z __concat__Z __contains__Z __delitem__r@Z __setitem__Z__iadd__Z__iand__Z __iconcat__Z __ifloordiv__Z __ilshift__Z__imod__Z__imul__Z __imatmul__Z__ior__Z__ipow__Z __irshift__Z__isub__Z __itruediv__Z__ixor__r7r7r7r;Z s    )')