o bc)@sdZgdZddlmZddZddZdd Zd d Zd d Z ddZ ddZ ddZ ddZ ddZddZddZddZddZd d!Zd"d#ZeZd$d%Zd&d'Zd(d)Zd*d+Zd,d-Zd.d/Zd0d1Zd2d3Zd4d5Zd6d7Zd8d9Zd:d;Z dd?Z"d@dAZ#dBdCZ$dDdEZ%dFdGZ&dHdIZ'dqdJdKZ(GdLdMdMZ)GdNdOdOZ*GdPdQdQZ+dRdSZ,dTdUZ-dVdWZ.dXdYZ/dZd[Z0d\d]Z1d^d_Z2d`daZ3dbdcZ4dddeZ5dfdgZ6dhdiZ7djdkZ8dldmZ9zddnl:TWn e;yYnwddol: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. )6absaddand_ attrgetterconcatcontainscountOfdelitemeqfloordivgegetitemgtiaddiandiconcat ifloordivilshiftimatmulimodimulindexindexOfinvinvertioripowirshiftis_is_notisub itemgetteritruedivixorle length_hintlshiftltmatmul methodcallermodmulnenegnot_or_pospowrshiftsetitemsubtruedivtruthxor)rcCs||kS)zSame as a < b.abr8r8i/home/lily/lilypond-2.24.1/release/binaries/dependencies/install/Python-3.10.8/lib/python3.10/operator.pyr&r&cCs||kS)zSame as a <= b.r8r9r8r8r<r#r=r#cCs||kS)zSame as a == b.r8r9r8r8r<r #r=r cCs||kS)zSame as a != b.r8r9r8r8r<r+'r=r+cCs||kS)zSame as a >= b.r8r9r8r8r<r +r=r cCs||kS)zSame as a > b.r8r9r8r8r<r /r=r cCs| S)zSame as not a.r8r:r8r8r<r-5r-cCs |rdSdS)z*Return True if a is true, False otherwise.TFr8r>r8r8r<r59 r5cCs||uS)zSame as a is b.r8r9r8r8r<r=r=rcCs||uS)zSame as a is not b.r8r9r8r8r<rAr=rcCst|S)zSame as abs(a).)_absr>r8r8r<rGr=rcCs||S)zSame as a + b.r8r9r8r8r<rKr=rcCs||@S)zSame as a & b.r8r9r8r8r<rOr=rcCs||S)zSame as a // b.r8r9r8r8r<r Sr=r cCs|S)zSame as a.__index__().) __index__r>r8r8r<rWr=rcCs|S)z Same as ~a.r8r>r8r8r<r[r?rcCs||>S)zSame as a << b.r8r9r8r8r<r%`r=r%cCs||S)zSame as a % b.r8r9r8r8r<r)dr=r)cCs||S)zSame as a * b.r8r9r8r8r<r*hr=r*cCs||S)zSame as a @ b.r8r9r8r8r<r'lr=r'cCs| S)z Same as -a.r8r>r8r8r<r,pr?r,cCs||BS)zSame as a | b.r8r9r8r8r<r.tr=r.cCs| S)z Same as +a.r8r>r8r8r<r/xr?r/cCs||S)zSame as a ** b.r8r9r8r8r<r0|r=r0cCs||?S)zSame as a >> b.r8r9r8r8r<r1r=r1cCs||S)zSame as a - b.r8r9r8r8r<r3r=r3cCs||S)zSame as a / b.r8r9r8r8r<r4r=r4cCs||AS)zSame as a ^ b.r8r9r8r8r<r6r=r6cCs(t|dsdt|j}t|||S)z%Same as a + b, for a and b sequences. __getitem__!'%s' object can't be concatenatedhasattrtype__name__ TypeErrorr:r;msgr8r8r<rs rcCs||vS)z(Same as b in a (note reversed operands).r8r9r8r8r<rr=rcCs*d}|D]}||us||kr|d7}q|S)z=Return the number of items in a which are, or which equal, b.r7r8)r:r;countir8r8r<rs rcCs ||=dS)zSame as del a[b].Nr8r9r8r8r<rs rcCs||S)z Same as a[b].r8r9r8r8r<r r=r cCs2t|D]\}}||us||kr|Sqtd)z!Return the first index of b in a.z$sequence.index(x): x not in sequence) enumerate ValueError)r:r;rNjr8r8r<rs rcCs |||<dS)zSame as a[b] = c.Nr8)r:r;cr8r8r<r2r@r2cCst|tsdt|j}t|zt|WStyYnwzt|j}Wn ty1|YSwz||}Wn tyC|YSw|turJ|St|tsZdt|j}t||dkrdd}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 %sr7z$__length_hint__() should return >= 0) isinstanceintrGrHrIlen__length_hint__AttributeErrorNotImplementedrP)objdefaultrKZhintvalr8r8r<r$s>       r$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_callcsp|st|ts td|f|_|dfdd}||_dS|f||_ttt|jfdd}||_dS)Nzattribute name must be a string.csD]}t||}q|SN)getattr)rYname)namesr8r<funcs z!attrgetter.__init__..funcctfddDS)Nc3s|]}|VqdSr`r8).0getterrYr8r< z4attrgetter.__init__..func..tuplerh)gettersrhr<rd) rSstrrIr]splitr^rlmapr)selfattrZattrsrdr8)rmrcr<__init__s       zattrgetter.__init__cC ||Sr`r^rrrYr8r8r<__call__ zattrgetter.__call__cC$d|jj|jjdtt|jfSN %s.%s(%s), ) __class__ __module__ __qualname__joinrqreprr]rrr8r8r<__repr__zattrgetter.__repr__cC |j|jfSr`)r~r]rr8r8r< __reduce__ zattrgetter.__reduce__N rHrr__doc__ __slots__rtrxrrr8r8r8r<rs rc@r\) 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]) _itemsr^csHsf|_fdd}||_dSf|_fdd}||_dS)Ncs|Sr`r8rh)itemr8r<rdsz!itemgetter.__init__..funccre)Nc3s|]}|VqdSr`r8)rfrNrhr8r<rirjz4itemgetter.__init__..func..rkrh)itemsrhr<rdrnr)rrrrrdr8)rrr<rts    zitemgetter.__init__cCrur`rvrwr8r8r<rxryzitemgetter.__call__cCrzr{)r~rrHrrqrrrr8r8r<r rzitemgetter.__repr__cCrr`)r~rrr8r8r<r%rzitemgetter.__reduce__Nrr8r8r8r<r s  r c@r\) 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_kwargscOs*||_t|jts td||_||_dS)Nzmethod name must be a string)rrSrorIrr)rrrbargskwargsr8r8r<rt1s   zmethodcaller.__init__cCst||j|ji|jSr`)rarrrrwr8r8r<rx8szmethodcaller.__call__cCsTt|jg}|tt|j|dd|jDd|jj|jj d |fS)Ncss |] \}}d||fVqdS)z%s=%rNr8)rfkvr8r8r<ri>sz(methodcaller.__repr__..r|r}) rrextendrqrrrr~rrHr)rrrr8r8r<r;s zmethodcaller.__repr__cCsD|js |j|jf|jfSddlm}||j|jfi|j|jfS)Nr7)partial)rr~rr functoolsr)rrrr8r8r<rCs zmethodcaller.__reduce__Nrr8r8r8r<r((s r(cCs ||7}|S)zSame as a += b.r8r9r8r8r<rMrcCs ||M}|S)zSame as a &= b.r8r9r8r8r<rRrrcCs,t|dsdt|j}t|||7}|S)z&Same as a += b, for a and b sequences.rCrDrErJr8r8r<rWs rcCs ||}|S)zSame as a //= b.r8r9r8r8r<r_rrcCs ||K}|S)zSame as a <<= b.r8r9r8r8r<rdrrcCs ||;}|S)zSame as a %= b.r8r9r8r8r<rirrcCs ||9}|S)zSame as a *= b.r8r9r8r8r<rnrrcCs ||}|S)zSame as a @= b.r8r9r8r8r<rsrrcCs ||O}|S)zSame as a |= b.r8r9r8r8r<rxrrcCs ||C}|S)zSame as a **= b.r8r9r8r8r<r}rrcCs ||L}|S)zSame as a >>= b.r8r9r8r8r<rrrcCs ||8}|S)zSame as a -= b.r8r9r8r8r<rrrcCs ||}|S)zSame as a /= b.r8r9r8r8r<r!rr!cCs ||N}|S)zSame as a ^= b.r8r9r8r8r<r"rr")*)rN)r7)ir__all__builtinsrrAr&r#r r+r r r-r5rrrrr rrrr%r)r*r'r,r.r/r0r1r3r4r6rrrrr rr2r$rr r(rrrrrrrrrrrrr!r"Z _operator ImportError__lt____le____eq____ne____ge____gt__Z__not____abs____add____and__ __floordiv__rBZ__inv__ __invert__ __lshift____mod____mul__ __matmul____neg____or____pos____pow__ __rshift____sub__ __truediv____xor__Z __concat__ __contains__ __delitem__rC __setitem____iadd____iand__Z __iconcat__ __ifloordiv__ __ilshift____imod____imul__ __imatmul____ior____ipow__ __irshift____isub__ __itruediv____ixor__r8r8r8r<s  )'%