ÿØÿàJFIFÿþ ÿÛC       ÿÛC ÿÀÿÄÿÄ"#QrÿÄÿÄ&1!A"2qQaáÿÚ ?Øy,æ/3JæÝ¹È߲؋5êXw²±ÉyˆR”¾I0ó2—PI¾IÌÚiMö¯–þrìN&"KgX:Šíµ•nTJnLK„…@!‰-ý ùúmë;ºgµŒ&ó±hw’¯Õ@”Ü— 9ñ-ë.²1<yà‚¹ïQÐU„ہ?.’¦èûbß±©Ö«Âw*VŒ) `$‰bØÔŸ’ëXÖ-ËTÜíGÚ3ð«g Ÿ§¯—Jx„–’U/ÂÅv_s(Hÿ@TñJÑãõçn­‚!ÈgfbÓc­:él[ðQe 9ÀPLbÃãCµm[5¿ç'ªjglå‡Ûí_§Úõl-;"PkÞÞÁQâ¼_Ñ^¢SŸx?"¸¦ùY騐ÒOÈ q’`~~ÚtËU¹CڒêV  I1Áß_ÿÙ A[c@@sdZddlmZddlZddlmZddlmZm Z ddl m Z m ZddlZddlZddlmZddlmZmZmZdd lmZmZmZmZdd l m!Z!m"Z"m#Z#m$Z$d Zdd lm%Z%e$r@ydd l&m'Z'Wn!e(k r<dd l)m'Z'nXn8ydd l*m'Z'Wn!e(k rwdd l+m'Z'nXddZ,de-fdYZ.de/fdYZ0y$ddl m Z ddlm1Z1Wne(k rnXdZ2de/fdYZ3dZ4dddZ5de fdYZ6ddlm7Z7e7e8dZ9d Z:e0Z;e3Z<e4Z=e5Z>eZ?e2Z@e,ZAe6ZBe9ZCe:ZDejEd!d"fkrdd#lm0Z0m3Z3dd$lm5Z5dd%lFm:Z:ydd&lm4Z4Wne(k r nXdd'lm9Z9nejEd(dfkrWddlmZdd)lm2Z2nejEd(d(fkrdd*lGm,Z,dd+lm6Z6ndS(,s Miscellaneous function (re)definitions from the Py3.4+ standard library for Python 2.6/2.7. - math.ceil (for Python 2.7) - collections.OrderedDict (for Python 2.6) - collections.Counter (for Python 2.6) - collections.ChainMap (for all versions prior to Python 3.3) - itertools.count (for Python 2.6, with step parameter) - subprocess.check_output (for Python 2.6) - reprlib.recursive_repr (for Python 2.6+) - functools.cmp_to_key (for Python 2.6) i(tabsolute_importN(tceil(tMappingtMutableMapping(t itemgetterteq(tproxy(trepeattchaintstarmap(t getaddrinfot SOCK_STREAMterrortsocket(t iteritemst itervaluestPY26tPY3cC@stt|S(sZ Return the ceiling of x as an int. This is the smallest integral value >= x. (tinttoldceil(tx((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyRs(tislice(t get_idents...c@sfd}|S(sGDecorator to make a repr function return fillvalue for a recursive callc@smtfd}td|_td|_td|_tdi|_|S(Nc@sWt|tf}|kr%Sj|z|}Wdj|X|S(N(tidRtaddtdiscard(tselftkeytresult(t fillvaluet repr_runningt user_function(sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pytwrapper?s  t __module__t__doc__t__name__t__annotations__(tsettgetattrR!R"R#R$(RR (R(RRsF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pytdecorating_function<s  ((RR'((RsF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pytrecursive_repr9st_LinkcB@seZdZRS(tprevtnextRt __weakref__(R*R+RR,(R#R!t __slots__(((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyR)Xst OrderedDictcB@seZdZdZejeedZejdZdZ dZ dZ e dZ e dZd ZejZZejZejZejZejZeZed Zdd Zed Zd ZdZe ddZ!dZ"RS(s)Dictionary that remembers insertion ordercO@s|stdn|d}|d}t|dkrTtdt|ny |jWnLtk rt|_t|j|_}||_|_i|_ nX|j ||dS(sInitialize an ordered dictionary. The signature is the same as regular dictionaries, but keyword arguments are not recommended because their insertion order is arbitrary. s?descriptor '__init__' of 'OrderedDict' object needs an argumentiis$expected at most 1 arguments, got %dN( t TypeErrortlent_OrderedDict__roottAttributeErrorR)t_OrderedDict__hardroott_proxyR*R+t_OrderedDict__mapt_OrderedDict__update(targstkwdsRtroot((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyt__init__js      c C@s~||krj||j|<}|j}|j}||||_|_|_||_|||_n||||dS(s!od.__setitem__(i, y) <==> od[i]=yN(R5R1R*R+R( RRtvaluet dict_setitemRtLinktlinkR9tlast((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyt __setitem__s    cC@sG||||jj|}|j}|j}||_||_dS(s od.__delitem__(y) <==> del od[y]N(R5tpopR*R+(RRt dict_delitemR>t link_prevt link_next((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyt __delitem__s     cc@s:|j}|j}x!||k r5|jV|j}qWdS(sod.__iter__() <==> iter(od)N(R1R+R(RR9tcurr((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyt__iter__s   cc@s:|j}|j}x!||k r5|jV|j}qWdS(s#od.__reversed__() <==> reversed(od)N(R1R*R(RR9RF((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyt __reversed__s   cC@s7|j}||_|_|jjtj|dS(s.od.clear() -> None. Remove all items from od.N(R1R*R+R5tcleartdict(RR9((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyRIs  cC@s|stdn|j}|rK|j}|j}||_||_n$|j}|j}||_||_|j}|j|=tj||}||fS(sod.popitem() -> (k, v), return and remove a (key, value) pair. Pairs are returned in LIFO order if last is true or FIFO order if false. sdictionary is empty(tKeyErrorR1R*R+RR5RJRA(RR?R9R>RCRDRR;((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pytpopitems            cC@s|j|}|j}|j}||_||_|j}|rn|j}||_||_||_|_n+|j}||_||_||_|_dS(sMove an existing element to the end (or beginning if last==False). Raises KeyError if the element does not exist. When last=True, acts like a fast version of self[key]=self.pop(key). N(R5R*R+R1(RRR?R>RCRDR9tfirst((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyt move_to_ends            cC@sqtj}t|d}||j}|||jd7}|||j|7}|||j|7}|S(Nii(tsyst getsizeofR0t__dict__R5R3R1(Rtsizeoftntsize((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyt __sizeof__s cC@sC||kr!||}||=|S||jkr?t|n|S(sod.pop(k[,d]) -> v, remove specified key and return the corresponding value. If key is not found, d is returned if given, otherwise KeyError is raised. (t_OrderedDict__markerRK(RRtdefaultR((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyRAs  cC@s"||kr||S|||<|S(sDod.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in od((RRRW((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyt setdefaults  cC@s7|sd|jjfSd|jjt|jfS(sod.__repr__() <==> repr(od)s%s()s%s(%r)(t __class__R#tlisttitems(R((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyt__repr__scC@sdt|j}x'ttD]}|j|dq"W|jd|pNddt|jfS(s%Return state information for picklingN((tvarstcopyR.RAtNoneRYtiterR[(Rt inst_dicttk((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyt __reduce__scC@s |j|S(s!od.copy() -> a shallow copy of od(RY(R((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyR^scC@s(|}x|D]}||| New ordered dictionary with keys from S. If not specified, the value defaults to None. ((tclstiterableR;RR((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pytfromkeyss  cC@sGt|tr7tj||o6ttt||Stj||S(sod.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive while comparison to a regular mapping is order-insensitive. (t isinstanceR.RJt__eq__talltmapt_eq(Rtother((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyRh$s(N(#R#R!R"R:RJR@R4R)RERGRHRItTrueRLRNRURtupdateR6tkeystvaluesR[t__ne__tobjectRVRAR_RXR(R\RcR^t classmethodRfRh(((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyR.[s0                (R(tnlargestcC@s5|j}x%|D]}||dd||>> c = Counter('abcdeabcdabcaba') # count elements from a string >>> c.most_common(3) # three most common elements [('a', 5), ('b', 4), ('c', 3)] >>> sorted(c) # list all unique elements ['a', 'b', 'c', 'd', 'e'] >>> ''.join(sorted(c.elements())) # list elements with repetitions 'aaaaabbbbcccdde' >>> sum(c.values()) # total of all counts 15 >>> c['a'] # count of letter 'a' 5 >>> for elem in 'shazam': # update counts from an iterable ... c[elem] += 1 # by adding 1 to each element's count >>> c['a'] # now there are seven 'a' 7 >>> del c['b'] # remove all 'b' >>> c['b'] # now there are zero 'b' 0 >>> d = Counter('simsalabim') # make another counter >>> c.update(d) # add in the second counter >>> c['a'] # now there are nine 'a' 9 >>> c.clear() # empty the counter >>> c Counter() Note: If a count is set to zero or reduced to zero, it will remain in the counter until the entry is deleted or the counter is cleared: >>> c = Counter('aaabbc') >>> c['b'] -= 2 # reduce the count of 'b' by two >>> c.most_common() # 'b' is still in, but its count is zero [('a', 3), ('c', 1), ('b', 0)] cO@s{|stdn|d}|d}t|dkrTtdt|ntt|j|j||dS(s Create a new, empty Counter object. And if given, count elements from an input iterable. Or, initialize the count from another mapping of elements to their counts. >>> c = Counter() # a new, empty counter >>> c = Counter('gallahad') # a new counter from an iterable >>> c = Counter({'a': 4, 'b': 2}) # a new counter from a mapping >>> c = Counter(a=4, b=2) # a new counter from keyword args s;descriptor '__init__' of 'Counter' object needs an argumentiis$expected at most 1 arguments, got %dN(R/R0tsuperRzR:Rn(R7R8R((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyR:ss   cC@sdS(s1The count of elements not in the Counter is zero.i((RR((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyt __missing__scC@sP|dkr.t|jdtddtStj||jdtdS(sList the n most common elements and their counts from the most common to the least. If n is None, then list all element counts. >>> Counter('abcdeabcdabcaba').most_common(3) [('a', 5), ('b', 4), ('c', 3)] RitreverseN(R_tsortedR[t _itemgetterRmt_heapqRt(RRS((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyt most_commons "cC@stjtt|jS(sIterator over elements repeating each as many times as its count. >>> c = Counter('ABCABC') >>> sorted(c.elements()) ['A', 'A', 'B', 'B', 'C', 'C'] # Knuth's example for prime factors of 1836: 2**2 * 3**3 * 17**1 >>> prime_factors = Counter({2: 2, 3: 3, 17: 1}) >>> product = 1 >>> for factor in prime_factors.elements(): # loop over factors ... product *= factor # and multiply them >>> product 1836 Note, if an element's count has been set to zero or is a negative number, elements() will ignore it. (t_chaint from_iterablet_starmapt_repeatR[(R((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pytelementsscC@stddS(Ns@Counter.fromkeys() is undefined. Use Counter(iterable) instead.(tNotImplementedError(RdRetv((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyRfscO@s|stdn|d}|d}t|dkrTtdt|n|rd|dnd}|dk rt|tr|r|j}xJ|jD]#\}}|||d||>> c = Counter('which') >>> c.update('witch') # add elements from another iterable >>> d = Counter('watch') >>> c.update(d) # add elements from another counter >>> c['h'] # four 'h' in which, witch, and watch 4 s9descriptor 'update' of 'Counter' object needs an argumentiis$expected at most 1 arguments, got %dN( R/R0R_RgRRuR[R{RzRnRy(R7R8RRetself_getRxtcount((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyRns"    cO@s |stdn|d}|d}t|dkrTtdt|n|rd|dnd}|dk r|j}t|trx\|jD]#\}}||d|||>> c = Counter('which') >>> c.subtract('witch') # subtract elements from another iterable >>> c.subtract(Counter('watch')) # subtract elements from another counter >>> c['h'] # 2 in which, minus 1 in witch, minus 1 in watch 0 >>> c['w'] # 1 in which, minus 1 in witch, minus 1 in watch -1 s;descriptor 'subtract' of 'Counter' object needs an argumentiis$expected at most 1 arguments, got %dN(R/R0R_RuRgRR[tsubtract(R7R8RReRRxR((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyRs      cC@s |j|S(sReturn a shallow copy.(RY(R((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyR^scC@s|jt|ffS(N(RYRJ(R((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyRc scC@s)||kr%tt|j|ndS(sGLike dict.__delitem__() but does not raise KeyError for missing values.N(R{RzRE(RRx((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyRE s cC@s~|sd|jjSy9djtdj|j}d|jj|fSWn*tk rydj|jjt|SXdS(Ns%s()s, s%r: %rs%s({%s})s {0}({1!r})( RYR#tjoinRjt__mod__RR/tformatRJ(RR[((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyR\s! cC@st|tstSt}xA|jD]3\}}|||}|dkr)|||>> Counter('abbb') + Counter('bcc') Counter({'b': 4, 'c': 2, 'a': 1}) i(RgRztNotImplementedR[(RRlRRxRtnewcount((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyt__add__$s  cC@st|tstSt}xA|jD]3\}}|||}|dkr)|||>> Counter('abbbc') - Counter('bccd') Counter({'b': 2, 'a': 1}) i(RgRzRR[(RRlRRxRR((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyt__sub__7s  cC@st|tstSt}xU|jD]G\}}||}||krQ|n|}|dkr)|||>> Counter('abbb') | Counter('bcc') Counter({'b': 3, 'c': 2, 'a': 1}) i(RgRzRR[(RRlRRxRt other_countR((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyt__or__Js   cC@sxt|tstSt}xU|jD]G\}}||}||krQ|n|}|dkr)|||>> Counter('abbb') & Counter('bcc') Counter({'b': 1}) i(RgRzRR[(RRlRRxRRR((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyt__and__^s   cC@s |tS(sEAdds an empty counter, effectively stripping negative and zero counts(Rz(R((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyt__pos__oscC@s t|S(s{Subtracts from an empty counter. Strips positive and zero counts, and flips the sign on negative counts. (Rz(R((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyt__neg__sscC@sMg|jD]\}}|dks |^q }x|D] }||=q8W|S(s?Internal method to strip elements with a negative or zero counti(R[(RRxRt nonpositive((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyt_keep_positivezs1  cC@s7x*|jD]\}}||c|7>> c = Counter('abbb') >>> c += Counter('bcc') >>> c Counter({'b': 4, 'c': 2, 'a': 1}) (R[R(RRlRxR((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyt__iadd__s cC@s7x*|jD]\}}||c|8>> c = Counter('abbbc') >>> c -= Counter('bccd') >>> c Counter({'b': 2, 'a': 1}) (R[R(RRlRxR((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyt__isub__s cC@sJx=|jD]/\}}||}||kr |||>> c = Counter('abbb') >>> c |= Counter('bcc') >>> c Counter({'b': 3, 'c': 2, 'a': 1}) (R[R(RRlRxRR((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyt__ior__s   cC@sJx=|jD]/\}}||}||kr |||>> c = Counter('abbb') >>> c &= Counter('bcc') >>> c Counter({'b': 1}) (R[R(RRlRxRR((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyt__iand__s   N(R#R!R"R:R|R_RRRsRfRnRR^RcRER\RRRRRRRRRRR(((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyRz@s0+    ) #            cO@sd|krtdntjdtj||}|j\}}|j}|r|jd}|dkr|d}ntj||n|S(s[ For Python 2.6 compatibility: see http://stackoverflow.com/questions/4814970/ tstdouts3stdout argument not allowed, it will be overridden.R7iN( t ValueErrort subprocesstPopentPIPEt communicatetpollRuR_tCalledProcessError(t popenargstkwargstprocesstoutputt unused_errtretcodetcmd((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyt check_outputs    icc@s xtr|V||7}qWdS(s ``itertools.count`` in Py 2.6 doesn't accept a step parameter. This is an enhanced version of ``itertools.count`` for Py2.6 equivalent to ``itertools.count`` in Python 2.7+. N(Rm(tstarttstep((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyRs tChainMapcB@seZdZdZdZdZddZdZdZ dZ dZ e Z e d Zed Zd ZeZdd Zed ZdZdZdZdZdZRS(s A ChainMap groups multiple dicts (or other mappings) together to create a single, updateable view. The underlying mappings are stored in a list. That list is public and can accessed or updated using the *maps* attribute. There is no other state. Lookups search the underlying mappings successively until a key is found. In contrast, writes, updates, and deletions only operate on the first mapping. cG@st|pig|_dS(sInitialize a ChainMap by setting *maps* to the given mappings. If no mappings are provided, a single empty dictionary is used. N(RZtmaps(RR((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyR:scC@st|dS(N(RK(RR((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyR|scC@sAx1|jD]&}y ||SWq tk r/q Xq W|j|S(N(RRKR|(RRRv((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyt __getitem__s   cC@s||kr||S|S(N((RRRW((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyRuscC@sttj|jS(N(R0R%tunionR(R((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyt__len__scC@sttj|jS(N(R`R%RR(R((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyRGsc@stfd|jDS(Nc3@s|]}|kVqdS(N((t.0tm(R(sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pys s(tanyR(RR((RsF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyt __contains__scC@s t|jS(N(RR(R((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyt__bool__ scC@s%dj|djtt|jS(Ns{0.__class__.__name__}({1})s, (RRRjtreprR(R((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyR\scG@s|tj||S(s?Create a ChainMap with a single dict created from the iterable.(RJRf(RdReR7((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyRfscC@s$|j|jdj|jdS(sHNew ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]ii(RYRR^(R((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyR^scC@s(|dkri}n|j||jS(s New ChainMap with a new map followed by all previous maps. If no map is provided, an empty dict is used. N(R_RYR(RR((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pyt new_childs  cC@s|j|jdS(sNew ChainMap from maps[1:].i(RYR(R((sF/opt/alt/python27/lib/python2.7/site-packages/future/backports/misc.pytparents(scC@s||jd| s   ""      { l (