ROOTPLOIT
Server: LiteSpeed
System: Linux server71.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
User: niphet (1079)
PHP: 5.3.29
Disabled: NONE
Upload Files
File: //lib64/python3.8/concurrent/futures/__pycache__/_base.cpython-38.opt-1.pyc
U

e5dY
@spdZddlZddlZddlZddlZdZdZdZdZdZ	dZ
d	Zd
ZdZ
e	e
eee
gZe	de
d
edede
diZedZGdddeZGdddeZGdddeZGdddeZGdddeZGdddeZGdddeZGdd d eZGd!d"d"eZd#d$Zd%d&Zd3d'd(Ze d)d*Z!defd+d,Z"Gd-d.d.eZ#Gd/d0d0eZ$Gd1d2d2e%Z&dS)4z"Brian Quinlan (brian@sweetapp.com)NFIRST_COMPLETEDFIRST_EXCEPTION
ALL_COMPLETED
_AS_COMPLETEDPENDINGRUNNING	CANCELLEDCANCELLED_AND_NOTIFIEDFINISHEDpendingrunning	cancelledfinishedzconcurrent.futuresc@seZdZdZdS)Errorz-Base class for all future-related exceptions.N__name__
__module____qualname____doc__rr0/usr/lib64/python3.8/concurrent/futures/_base.pyr,src@seZdZdZdS)CancelledErrorzThe Future was cancelled.Nrrrrrr0src@seZdZdZdS)TimeoutErrorz*The operation exceeded the given deadline.Nrrrrrr4src@seZdZdZdS)InvalidStateErrorz+The operation is not allowed in this state.Nrrrrrr8src@s0eZdZdZddZddZddZdd	Zd
S)_Waiterz;Provides the event that wait() and as_completed() block on.cCst|_g|_dSN)	threadingZEventeventfinished_futuresselfrrr__init__>s
z_Waiter.__init__cCs|j|dSrrappendr futurerrr
add_resultBsz_Waiter.add_resultcCs|j|dSrr"r$rrr
add_exceptionEsz_Waiter.add_exceptioncCs|j|dSrr"r$rrr
add_cancelledHsz_Waiter.add_cancelledN)rrrrr!r&r'r(rrrrr<s
rcsDeZdZdZfddZfddZfddZfdd	ZZS)
_AsCompletedWaiterzUsed by as_completed().cstt|t|_dSr)superr)r!rLocklockr	__class__rrr!Nsz_AsCompletedWaiter.__init__c	s0|j tt|||jW5QRXdSr)r,r*r)r&rsetr$r-rrr&Rsz_AsCompletedWaiter.add_resultc	s0|j tt|||jW5QRXdSr)r,r*r)r'rr/r$r-rrr'Wsz _AsCompletedWaiter.add_exceptionc	s0|j tt|||jW5QRXdSr)r,r*r)r(rr/r$r-rrr(\sz _AsCompletedWaiter.add_cancelled)	rrrrr!r&r'r(
__classcell__rrr-rr)Ks
r)cs8eZdZdZfddZfddZfddZZS)_FirstCompletedWaiterz*Used by wait(return_when=FIRST_COMPLETED).cst||jdSr)r*r&rr/r$r-rrr&dsz _FirstCompletedWaiter.add_resultcst||jdSr)r*r'rr/r$r-rrr'hsz#_FirstCompletedWaiter.add_exceptioncst||jdSr)r*r(rr/r$r-rrr(lsz#_FirstCompletedWaiter.add_cancelled)rrrrr&r'r(r0rrr-rr1asr1csLeZdZdZfddZddZfddZfdd	Zfd
dZZ	S)_AllCompletedWaiterz<Used by wait(return_when=FIRST_EXCEPTION and ALL_COMPLETED).cs$||_||_t|_tdSr)num_pending_callsstop_on_exceptionrr+r,r*r!)r r3r4r-rrr!ss
z_AllCompletedWaiter.__init__c	Cs4|j$|jd8_|js&|jW5QRXdS)N)r,r3rr/rrrr_decrement_pending_callsysz,_AllCompletedWaiter._decrement_pending_callscst||dSr)r*r&r6r$r-rrr&sz_AllCompletedWaiter.add_resultcs*t||jr|jn|dSr)r*r'r4rr/r6r$r-rrr'sz!_AllCompletedWaiter.add_exceptioncst||dSr)r*r(r6r$r-rrr(sz!_AllCompletedWaiter.add_cancelled)
rrrrr!r6r&r'r(r0rrr-rr2psr2c@s(eZdZdZddZddZddZdS)	_AcquireFutureszDA context manager that does an ordered acquire of Future conditions.cCst|td|_dS)N)key)sortedidfutures)r r;rrrr!sz_AcquireFutures.__init__cCs|jD]}|jqdSr)r;
_conditionacquirer$rrr	__enter__s
z_AcquireFutures.__enter__cGs|jD]}|jqdSr)r;r<release)r argsr%rrr__exit__s
z_AcquireFutures.__exit__N)rrrrr!r>rArrrrr7sr7cCs|tkrt}nZ|tkr t}nJtdd|D}|tkrHt|dd}n"|tkr^t|dd}ntd||D]}|j	
|qn|S)Ncss|]}|jttfkVqdSr_stater	r
.0frrr	<genexpr>sz._create_and_install_waiters.<locals>.<genexpr>T)r4FzInvalid return condition: %r)rr)rr1sumrr2r
ValueError_waitersr#)fsreturn_whenwaiterZ
pending_countrFrrr_create_and_install_waiterssrNc	csP|rL|d}|D]}||q|j|j|W5QRX~|VqdS)a~
    Iterate on the list *fs*, yielding finished futures one by one in
    reverse order.
    Before yielding a future, *waiter* is removed from its waiters
    and the future is removed from each set in the collection of sets
    *ref_collect*.

    The aim of this function is to avoid keeping stale references after
    the future is yielded and before the iterator resumes.
    N)remover<rJpop)rKrMref_collectrFZfutures_setrrr_yield_finished_futuressrSc	csB|dk	r|t}t|}t|}t|*tdd|D}||}t|t}W5QRXt|}zt|||fdEdH|r|dkrd}n(|t}|dkrtdt||f|j
||j|j}g|_|j
W5QRX|t||||fdEdHq|W5|D]$}|j|j	
|W5QRXqXdS)anAn 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.
    Ncss |]}|jttfkr|VqdSrrBrDrrrrGszas_completed.<locals>.<genexpr>)rRrz%d (of %d) futures unfinished)time	monotonicr/lenr7rNrlistr<rJrPrSrrwaitr,rclearreverse)	rKtimeoutend_timeZ
total_futuresrrrMrFZwait_timeoutrrras_completedsL
r]DoneAndNotDoneFuturesz
done not_donec
Cs
t|tdd|D}t||}|tkrJ|rJt||W5QRS|tkr~|r~tdd|Dr~t||W5QRSt|t|krt||W5QRSt||}W5QRX|j	||D]"}|j
|j|W5QRXq|
|jt|t||S)aWait 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 |]}|jttfkr|VqdSrrBrDrrrrG!szwait.<locals>.<genexpr>css&|]}|s|dk	r|VqdSr)r
	exceptionrDrrrrG(s)r7r/rr^ranyrVrNrrXr<rJrPupdater)rKr[rLdoneZnot_donerMrFrrrrXs"
rXc@seZdZdZddZddZddZdd	Zd
dZdd
Z	ddZ
ddZddZdddZ
d ddZddZddZddZdS)!Futurez5Represents the result of an asynchronous computation.cCs,t|_t|_d|_d|_g|_g|_dS)z8Initializes the future. Should not be called by clients.N)	rZ	Conditionr<rrC_result
_exceptionrJ_done_callbacksrrrrr!<s
zFuture.__init__c	Cs>|jD]2}z||Wqtk
r6td|YqXqdS)N!exception calling callback for %r)rf	ExceptionLOGGERr_)r callbackrrr_invoke_callbacksEs

zFuture._invoke_callbacksc
Cs|j|jtkrx|jrHd|jjt|t|j|jjjfW5QRSd|jjt|t|j|jjjfW5QRSd|jjt|t|jfW5QRSQRXdS)Nz<%s at %#x state=%s raised %s>z <%s at %#x state=%s returned %s>z<%s at %#x state=%s>)	r<rCr
rer.rr:_STATE_TO_DESCRIPTION_MAPrdrrrr__repr__Ls(
zFuture.__repr__c	Csf|jN|jttfkr$W5QRdS|jttfkr@W5QRdSt|_|jW5QRX|dS)zCancel 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.
        FT)r<rCrr
rr	
notify_allrkrrrrcancel`sz
Future.cancelc
Cs,|j|jttfkW5QRSQRXdS)z(Return True if the future was cancelled.N)r<rCrr	rrrrr
sszFuture.cancelledc
Cs(|j|jtkW5QRSQRXdS)z1Return True if the future is currently executing.N)r<rCrrrrrrxszFuture.runningc
Cs.|j|jtttfkW5QRSQRXdS)z>Return True of the future was cancelled or finished executing.N)r<rCrr	r
rrrrrb}szFuture.donecCs$|jrz
|jW5d}Xn|jSdSr)rerdrrrrZ__get_results

zFuture.__get_resultc	Csn|j0|jtttfkr2|j|W5QRdSW5QRXz||Wn tk
rht	d|YnXdS)a%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.
        Nrg)
r<rCrr	r
rfr#rhrir_)r fnrrradd_done_callbackszFuture.add_done_callbackNc
Csz|j|jttfkr tn"|jtkrB|W5QRWZS|j||jttfkrdtn(|jtkr|W5QRWStW5QRXW5d}XdS)aBReturn 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)	r<rCrr	rr
_Future__get_resultrXrr r[rrrresults

z
Future.resultc
Cs|j||jttfkrtn|jtkr:|jW5QRS|j||jttfkr\tn"|jtkrx|jW5QRStW5QRXdS)aUReturn 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)	r<rCrr	rr
rerXrrsrrrr_s

zFuture.exceptionc	Cs|jt|jtkr<t|_|jD]}||qW5QRdS|jtkrZt|_W5QRdSt	dt
||jtdW5QRXdS)aMark 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.
        FTz!Future %s in unexpected state: %szFuture in unexpected stateN)r<rCrr	rJr(rrriZcriticalr:RuntimeError)r rMrrrset_running_or_notify_cancels


z#Future.set_running_or_notify_cancelc	Csl|jT|jttthkr*td|j|||_t|_|jD]}|	|q<|j
W5QRX|dS)zSets the return value of work associated with the future.

        Should only be used by Executor implementations and unit tests.
        {}: {!r}N)r<rCrr	r
rformatrdrJr&rnrk)r rtrMrrr
set_result
s
zFuture.set_resultc	Csl|jT|jttthkr*td|j|||_t|_|jD]}|	|q<|j
W5QRX|dS)zSets the result of the future as being the given exception.

        Should only be used by Executor implementations and unit tests.
        rwN)r<rCrr	r
rrxrerJr'rnrk)r r_rMrrr
set_exceptions
zFuture.set_exception)N)N)rrrrr!rkrmror
rrbrrrqrtr_rvryrzrrrrrc9s	

#
"(rcc@sHeZdZdZddZde_ddddd	ZdddZd
dZddZ	dS)ExecutorzCThis is an abstract base class for concrete asynchronous executors.cOs\t|dkrnD|stdn6d|kr>ddl}|jdtddntdt|d	tdS)
a 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.
        z:descriptor 'submit' of 'Executor' object needs an argumentrprNz.Passing 'fn' as keyword argument is deprecated)
stacklevelz6submit expected at least 1 positional argument, got %dr5)rV	TypeErrorwarningswarnDeprecationWarningNotImplementedError)r@kwargsrrrrsubmit.s	

zExecutor.submitz($self, fn, /, *args, **kwargs)Nr5)r[	chunksizecsBdk	rtfddt|Dfdd}|S)a}Returns an 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.
            chunksize: The size of the chunks the iterable will be broken into
                before being passed to a child process. This argument is only
                used by ProcessPoolExecutor; it is ignored by
                ThreadPoolExecutor.

        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.
        Ncsg|]}jf|qSr)r)rEr@)rpr rr
<listcomp>`sz Executor.map.<locals>.<listcomp>c	3s\zBr@dkr&Vq
tVq
W5D]}|qHXdSr)rorZrQrtrTrU)r%)r\rKr[rrresult_iteratordsz%Executor.map.<locals>.result_iterator)rTrUzip)r rpr[r	iterablesrr)r\rprKr r[rmapGs

zExecutor.mapTcCsdS)aClean-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.
        Nr)r rXrrrshutdownsszExecutor.shutdowncCs|Srrrrrrr>szExecutor.__enter__cCs|jdddS)NT)rXF)r)r exc_typeZexc_valZexc_tbrrrrAszExecutor.__exit__)T)
rrrrr__text_signature__rrr>rArrrrr{+s,

r{c@seZdZdZdS)BrokenExecutorzR
    Raised when a executor has become non-functional after a severe failure.
    Nrrrrrrsr)N)'
__author__collectionsZloggingrrTrrrrrrrr	r
Z_FUTURE_STATESrlZ	getLoggerrirhrrrrobjectrr)r1r2r7rNrSr]
namedtupler^rXrcr{rurrrrr<module>sh		

>1s]