JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3RbrJFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbrў fLc@sdZddlZddlZddlZddlZdZdZdZdZdZ dZ d Z d Z d Z e e e e e gZid e 6d e 6de 6de 6de 6ZejdZGdddeZGdddeZGdddeZGdddeZGdddeZGdddeZGdddeZGdd d eZd!d"Zdd#d$Zejd%d&Z ded'd(Z!Gd)d*d*eZ"Gd+d,d,eZ#dS(-u"Brian Quinlan (brian@sweetapp.com)iNuFIRST_COMPLETEDuFIRST_EXCEPTIONu ALL_COMPLETEDu _AS_COMPLETEDuPENDINGuRUNNINGu CANCELLEDuCANCELLED_AND_NOTIFIEDuFINISHEDupendingurunningu cancelledufinisheduconcurrent.futurescBs|EeZdZdZdS(uErroru-Base class for all future-related exceptions.N(u__name__u __module__u __qualname__u__doc__(u __locals__((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyuError,suErrorcBs|EeZdZdZdS(uCancelledErroruThe Future was cancelled.N(u__name__u __module__u __qualname__u__doc__(u __locals__((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyuCancelledError0suCancelledErrorcBs|EeZdZdZdS(u TimeoutErroru*The operation exceeded the given deadline.N(u__name__u __module__u __qualname__u__doc__(u __locals__((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu TimeoutError4su TimeoutErrorcBsJ|EeZdZdZddZddZddZdd Zd S( u_Waiteru;Provides the event that wait() and as_completed() block on.cCstj|_g|_dS(N(u threadinguEventueventufinished_futures(uself((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu__init__:su_Waiter.__init__cCs|jj|dS(N(ufinished_futuresuappend(uselfufuture((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu add_result>su_Waiter.add_resultcCs|jj|dS(N(ufinished_futuresuappend(uselfufuture((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu add_exceptionAsu_Waiter.add_exceptioncCs|jj|dS(N(ufinished_futuresuappend(uselfufuture((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu add_cancelledDsu_Waiter.add_cancelledN(u__name__u __module__u __qualname__u__doc__u__init__u add_resultu add_exceptionu add_cancelled(u __locals__((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu_Waiter8s    u_Waitercsb|EeZdZdZfddZfddZfddZfdd ZS( u_AsCompletedWaiteruUsed by as_completed().cs&tt|jtj|_dS(N(usuperu_AsCompletedWaiteru__init__u threadinguLockulock(uself(u __class__(u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu__init__Jsu_AsCompletedWaiter.__init__c s7|j(tt|j||jjWdQXdS(N(ulockusuperu_AsCompletedWaiteru add_resultueventuset(uselfufuture(u __class__(u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu add_resultNs u_AsCompletedWaiter.add_resultc s7|j(tt|j||jjWdQXdS(N(ulockusuperu_AsCompletedWaiteru add_exceptionueventuset(uselfufuture(u __class__(u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu add_exceptionSs u _AsCompletedWaiter.add_exceptionc s7|j(tt|j||jjWdQXdS(N(ulockusuperu_AsCompletedWaiteru add_cancelledueventuset(uselfufuture(u __class__(u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu add_cancelledXs u _AsCompletedWaiter.add_cancelled(u__name__u __module__u __qualname__u__doc__u__init__u add_resultu add_exceptionu add_cancelled(u __locals__((u __class__u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu_AsCompletedWaiterGs u_AsCompletedWaitercsP|EeZdZdZfddZfddZfddZS(u_FirstCompletedWaiteru*Used by wait(return_when=FIRST_COMPLETED).cs!tj||jjdS(N(usuperu add_resultueventuset(uselfufuture(u __class__(u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu add_result`su _FirstCompletedWaiter.add_resultcs!tj||jjdS(N(usuperu add_exceptionueventuset(uselfufuture(u __class__(u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu add_exceptiondsu#_FirstCompletedWaiter.add_exceptioncs!tj||jjdS(N(usuperu add_cancelledueventuset(uselfufuture(u __class__(u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu add_cancelledhsu#_FirstCompletedWaiter.add_cancelled(u__name__u __module__u __qualname__u__doc__u add_resultu add_exceptionu add_cancelled(u __locals__((u __class__u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu_FirstCompletedWaiter]su_FirstCompletedWaitercsn|EeZdZdZfddZddZfddZfdd Zfd d ZS( u_AllCompletedWaiteru<Used by wait(return_when=FIRST_EXCEPTION and ALL_COMPLETED).cs2||_||_tj|_tjdS(N(unum_pending_callsustop_on_exceptionu threadinguLockulockusuperu__init__(uselfunum_pending_callsustop_on_exception(u __class__(u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu__init__os  u_AllCompletedWaiter.__init__c Cs<|j-|jd8_|js2|jjnWdQXdS(Ni(ulockunum_pending_callsueventuset(uself((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu_decrement_pending_callsus  u,_AllCompletedWaiter._decrement_pending_callscstj||jdS(N(usuperu add_resultu_decrement_pending_calls(uselfufuture(u __class__(u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu add_result{su_AllCompletedWaiter.add_resultcs7tj||jr)|jjn |jdS(N(usuperu add_exceptionustop_on_exceptionueventusetu_decrement_pending_calls(uselfufuture(u __class__(u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu add_exceptions u!_AllCompletedWaiter.add_exceptioncstj||jdS(N(usuperu add_cancelledu_decrement_pending_calls(uselfufuture(u __class__(u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu add_cancelledsu!_AllCompletedWaiter.add_cancelled( u__name__u __module__u __qualname__u__doc__u__init__u_decrement_pending_callsu add_resultu add_exceptionu add_cancelled(u __locals__((u __class__u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu_AllCompletedWaiterls  u_AllCompletedWaitercBs>|EeZdZdZddZddZddZdS( u_AcquireFuturesuDA context manager that does an ordered acquire of Future conditions.cCst|dt|_dS(Nukey(usorteduidufutures(uselfufutures((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu__init__su_AcquireFutures.__init__cCs%x|jD]}|jjq WdS(N(ufuturesu _conditionuacquire(uselfufuture((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu __enter__su_AcquireFutures.__enter__cGs%x|jD]}|jjq WdS(N(ufuturesu _conditionurelease(uselfuargsufuture((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu__exit__su_AcquireFutures.__exit__N(u__name__u __module__u __qualname__u__doc__u__init__u __enter__u__exit__(u __locals__((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu_AcquireFuturess  u_AcquireFuturescCs|tkrt}n|tkr0t}nktdd|D}|tkrjt|dd}n1|tkrt|dd}nt d|x|D]}|j j |qW|S(Ncss$|]}|jttgkVqdS(N(u_stateuCANCELLED_AND_NOTIFIEDuFINISHED(u.0uf((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu su._create_and_install_waiters..ustop_on_exceptionuInvalid return condition: %rTF( u _AS_COMPLETEDu_AsCompletedWaiteruFIRST_COMPLETEDu_FirstCompletedWaiterusumuFIRST_EXCEPTIONu_AllCompletedWaiteruTrueu ALL_COMPLETEDuFalseu ValueErroru_waitersuappend(ufsu return_whenuwaiteru pending_countuf((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu_create_and_install_waiterss       u_create_and_install_waitersc csx|dk r|tj}nt|}t|7tdd|D}||}t|t}WdQXzx|D] }|VqzWx|rM|dkrd}nA|tj}|dkrtdt|t|fn|jj ||j $|j }g|_ |jj WdQXx |D]}|V|j |q.WqWWdx|D]}|jj |qYWXdS(unAn iterator over the given futures that yields each as it completes. Args: fs: The sequence of Futures (possibly created by different Executors) to iterate over. timeout: The maximum number of seconds to wait. If None, then there is no limit on the wait time. Returns: An iterator that yields the given Futures as they complete (finished or cancelled). If any given Futures are duplicated, they will be returned once. Raises: TimeoutError: If the entire result iterator could not be generated before the given timeout. css*|] }|jttgkr|VqdS(N(u_stateuCANCELLED_AND_NOTIFIEDuFINISHED(u.0uf((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu suas_completed..Niu%d (of %d) futures unfinished(uNoneutimeusetu_AcquireFuturesu_create_and_install_waitersu _AS_COMPLETEDu TimeoutErrorulenueventuwaitulockufinished_futuresuclearuremoveu_waiters( ufsutimeoutuend_timeufinishedupendinguwaiterufutureu wait_timeoutuf((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu as_completeds:               u as_completeduDoneAndNotDoneFuturesu done not_donec Cs"t|tdd|D}t||}|tkrU|rUt||S|tkr|rtdd|Drt||Snt|t|krt||St||}WdQX|jj |x|D]}|j j |qW|j |j t|t||S(uWait for the futures in the given sequence to complete. Args: fs: The sequence of Futures (possibly created by different Executors) to wait upon. timeout: The maximum number of seconds to wait. If None, then there is no limit on the wait time. return_when: Indicates when this function should return. The options are: FIRST_COMPLETED - Return when any future finishes or is cancelled. FIRST_EXCEPTION - Return when any future finishes by raising an exception. If no future raises an exception then it is equivalent to ALL_COMPLETED. ALL_COMPLETED - Return when all futures finish or are cancelled. Returns: A named 2-tuple of sets. The first set, named 'done', contains the futures that completed (is finished or cancelled) before the wait completed. The second set, named 'not_done', contains uncompleted futures. css*|] }|jttgkr|VqdS(N(u_stateuCANCELLED_AND_NOTIFIEDuFINISHED(u.0uf((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu suwait..css4|]*}|j r|jdk r|VqdS(N(u cancelledu exceptionuNone(u.0uf((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu sN(u_AcquireFuturesusetuFIRST_COMPLETEDuDoneAndNotDoneFuturesuFIRST_EXCEPTIONuanyulenu_create_and_install_waitersueventuwaitu_waitersuremoveuupdateufinished_futures(ufsutimeoutu return_whenudoneunot_doneuwaiteruf((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyuwaits     uwaitcBs|EeZdZdZddZddZddZdd Zd d Zd d Z ddZ ddZ ddZ dddZdddZddZddZddZdS(uFutureu5Represents the result of an asynchronous computation.cCs@tj|_t|_d|_d|_g|_g|_ dS(u8Initializes the future. Should not be called by clients.N( u threadingu Conditionu _conditionuPENDINGu_stateuNoneu_resultu _exceptionu_waitersu_done_callbacks(uself((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu__init__s     uFuture.__init__c CsKxD|jD]9}y||Wq tk rBtjd|Yq Xq WdS(Nu!exception calling callback for %r(u_done_callbacksu ExceptionuLOGGERu exception(uselfucallback((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu_invoke_callbacks%s  uFuture._invoke_callbacksc Cs|j|jtkr|jrOdtt|t|j|jjjfSdtt|t|j|j jjfSndtt|t|jfSWdQXdS(Nu!u#u( u _conditionu_stateuFINISHEDu _exceptionuhexuidu_STATE_TO_DESCRIPTION_MAPu __class__u__name__u_result(uself((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu__repr__,s    uFuture.__repr__c Csf|jM|jttgkr#dS|jttgkr<dSt|_|jjWdQX|j dS(uCancel the future if possible. Returns True if the future was cancelled, False otherwise. A future cannot be cancelled if it is running or has already completed. NFT( u _conditionu_stateuRUNNINGuFINISHEDuFalseu CANCELLEDuCANCELLED_AND_NOTIFIEDuTrueu notify_allu_invoke_callbacks(uself((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyucancel=s   u Future.cancelc Cs'|j|jttgkSWdQXdS(u(Return True if the future was cancelled.N(u _conditionu_stateu CANCELLEDuCANCELLED_AND_NOTIFIED(uself((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu cancelledPs uFuture.cancelledc Cs!|j|jtkSWdQXdS(u1Return True if the future is currently executing.N(u _conditionu_stateuRUNNING(uself((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyurunningUs uFuture.runningc Cs*|j|jtttgkSWdQXdS(u>Return True of the future was cancelled or finished executing.N(u _conditionu_stateu CANCELLEDuCANCELLED_AND_NOTIFIEDuFINISHED(uself((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyudoneZs u Future.donecCs |jr|jn|jSdS(N(u _exceptionu_result(uself((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu __get_result_s  uFuture.__get_resultc CsJ|j1|jtttgkr6|jj|dSWdQX||dS(u%Attaches a callable that will be called when the future finishes. Args: fn: A callable that will be called with this future as its only argument when the future completes or is cancelled. The callable will always be called by a thread in the same process in which it was added. If the future has already completed or been cancelled then the callable will be called immediately. These callables are called in the order that they were added. N(u _conditionu_stateu CANCELLEDuCANCELLED_AND_NOTIFIEDuFINISHEDu_done_callbacksuappend(uselfufn((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyuadd_done_callbackes  uFuture.add_done_callbackc Cs|j|jttgkr+tn|jtkrD|jS|jj||jttgkrutn"|jtkr|jStWdQXdS(uBReturn the result of the call that the future represents. Args: timeout: The number of seconds to wait for the result if the future isn't done. If None, then there is no limit on the wait time. Returns: The result of the call that the future represents. Raises: CancelledError: If the future was cancelled. TimeoutError: If the future didn't finish executing before the given timeout. Exception: If the call raised then that exception will be raised. N( u _conditionu_stateu CANCELLEDuCANCELLED_AND_NOTIFIEDuCancelledErroruFINISHEDu_Future__get_resultuwaitu TimeoutError(uselfutimeout((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyuresultvs     u Future.resultc Cs|j|jttgkr+tn|jtkrA|jS|jj||jttgkrrtn|jtkr|jStWdQXdS(uUReturn the exception raised by the call that the future represents. Args: timeout: The number of seconds to wait for the exception if the future isn't done. If None, then there is no limit on the wait time. Returns: The exception raised by the call that the future represents or None if the call completed without raising. Raises: CancelledError: If the future was cancelled. TimeoutError: If the future didn't finish executing before the given timeout. N( u _conditionu_stateu CANCELLEDuCANCELLED_AND_NOTIFIEDuCancelledErroruFINISHEDu _exceptionuwaitu TimeoutError(uselfutimeout((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu exceptions   uFuture.exceptionc Cs|j|jtkrGt|_x|jD]}|j|q,WdS|jtkrct|_dSt j dt ||jt dWdQXdS(uMark the future as running or process any cancel notifications. Should only be used by Executor implementations and unit tests. If the future has been cancelled (cancel() was called and returned True) then any threads waiting on the future completing (though calls to as_completed() or wait()) are notified and False is returned. If the future was not cancelled then it is put in the running state (future calls to running() will return True) and True is returned. This method should be called by Executor implementations before executing the work associated with this future. If this method returns False then the work should not be executed. Returns: False if the Future was cancelled, True otherwise. Raises: RuntimeError: if this method was already called or if set_result() or set_exception() was called. u!Future %s in unexpected state: %suFuture in unexpected stateNFT(u _conditionu_stateu CANCELLEDuCANCELLED_AND_NOTIFIEDu_waitersu add_cancelleduFalseuPENDINGuRUNNINGuTrueuLOGGERucriticaluidu RuntimeError(uselfuwaiter((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyuset_running_or_notify_cancels      u#Future.set_running_or_notify_cancelc Cs^|jE||_t|_x|jD]}|j|q&W|jjWdQX|jdS(uSets the return value of work associated with the future. Should only be used by Executor implementations and unit tests. N(u _conditionu_resultuFINISHEDu_stateu_waitersu add_resultu notify_allu_invoke_callbacks(uselfuresultuwaiter((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu set_results   uFuture.set_resultc Cs^|jE||_t|_x|jD]}|j|q&W|jjWdQX|jdS(uSets the result of the future as being the given exception. Should only be used by Executor implementations and unit tests. N(u _conditionu _exceptionuFINISHEDu_stateu_waitersu add_exceptionu notify_allu_invoke_callbacks(uselfu exceptionuwaiter((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu set_exceptions   uFuture.set_exceptionN(u__name__u __module__u __qualname__u__doc__u__init__u_invoke_callbacksu__repr__ucancelu cancelledurunningudoneu_Future__get_resultuadd_done_callbackuNoneuresultu exceptionuset_running_or_notify_cancelu set_resultu set_exception(u __locals__((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyuFutures        " ( uFuturecBs_|EeZdZdZddZdd ddZdddZd d Z d d Z d S(uExecutoruCThis is an abstract base class for concrete asynchronous executors.cOs tdS(u Submits a callable to be executed with the given arguments. Schedules the callable to be executed as fn(*args, **kwargs) and returns a Future instance representing the execution of the callable. Returns: A Future representing the given call. N(uNotImplementedError(uselfufnuargsukwargs((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyusubmits uExecutor.submitutimeoutcs`dk rtjnfddt|Dfdd}|S(u}Returns a iterator equivalent to map(fn, iter). Args: fn: A callable that will take as many arguments as there are passed iterables. timeout: The maximum number of seconds to wait. If None, then there is no limit on the wait time. Returns: An iterator equivalent to: map(func, *iterables) but the calls may be evaluated out-of-order. Raises: TimeoutError: If the entire result iterator could not be generated before the given timeout. Exception: If fn(*args) raises for any values. cs"g|]}j|qS((usubmit(u.0uargs(ufnuself(u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu s u Executor.map..c 3sjzGx@D]8}dkr*|jVq |jtjVq WWdxD]}|jqQWXdS(N(uNoneuresultutimeucancel(ufuture(uend_timeufsutimeout(u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyuresult_iterator s    u%Executor.map..result_iteratorN(uNoneutimeuzip(uselfufnutimeoutu iterablesuresult_iterator((uend_timeufnufsuselfutimeoutu=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyumaps  " u Executor.mapcCsdS(uClean-up the resources associated with the Executor. It is safe to call this method several times. Otherwise, no other methods can be called after this one. Args: wait: If True then shutdown will not return until all running futures have finished executing and the resources used by the executor have been reclaimed. N((uselfuwait((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyushutdown,s uExecutor.shutdowncCs|S(N((uself((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu __enter__9suExecutor.__enter__cCs|jdddS(NuwaitTF(ushutdownuTrueuFalse(uselfuexc_typeuexc_valuexc_tb((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyu__exit__<suExecutor.__exit__NT( u__name__u __module__u __qualname__u__doc__usubmituNoneumapuTrueushutdownu __enter__u__exit__(u __locals__((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyuExecutors  % uExecutor($u __author__u collectionsuloggingu threadingutimeuFIRST_COMPLETEDuFIRST_EXCEPTIONu ALL_COMPLETEDu _AS_COMPLETEDuPENDINGuRUNNINGu CANCELLEDuCANCELLED_AND_NOTIFIEDuFINISHEDu_FUTURE_STATESu_STATE_TO_DESCRIPTION_MAPu getLoggeruLOGGERu ExceptionuErroruCancelledErroru TimeoutErroruobjectu_Waiteru_AsCompletedWaiteru_FirstCompletedWaiteru_AllCompletedWaiteru_AcquireFuturesu_create_and_install_waitersuNoneu as_completedu namedtupleuDoneAndNotDoneFuturesuwaituFutureuExecutor(((u=/opt/alt/python33/lib64/python3.3/concurrent/futures/_base.pyusP       : 0