[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.144.110.15: ~ $
U

��Q$�@s�dZddlZddlZddlZddlZzeWnek
rHdd�ZYnXejdkrje�d�Z	e�d�Z
ne�d�Z	e�d	�Z
dd
d�ZGdd
�d
e�Z
dS)z-Refactored 'safe reference from dispatcher.py�NcCs
t|d�S)N�__call__)�hasattr)�object�r�/_saferef.py�callable.sr)��im_self�im_func�__self__�__func__cCs�zt|�}Wn:tk
rFt|�r4t�||�YSt�|�YSYn:X|dk	r�t|d�spt|d�sptd|��t||d�}|SdS)a�Return a *safe* weak reference to a callable target.

    - ``target``: The object to be weakly referenced, if it's a bound
      method reference, will create a BoundMethodWeakref, otherwise
      creates a simple weakref.

    - ``on_delete``: If provided, will have a hard reference stored to
      the callable to be called after the safe reference goes out of
      scope with the reference object, (either a weakref or a
      BoundMethodWeakref) as argument.
    Nr
rzRsafe_ref target %r has im_self, but no im_func, don't know how to create reference)�target�	on_delete)�get_self�AttributeErrorr�weakref�refr�AssertionError�BoundMethodWeakref)r
rr	Z	referencerrr�safe_ref:s��rcsheZdZdZe��Zd�fdd�	Zddd�Zdd�Z	e
e	�Z	d	d
�ZeZdd�Z
d
d�Zdd�Z�ZS)ra�'Safe' and reusable weak references to instance methods.

    BoundMethodWeakref objects provide a mechanism for referencing a
    bound method without requiring that the method object itself
    (which is normally a transient object) is kept alive.  Instead,
    the BoundMethodWeakref object keeps weak references to both the
    object and the function which together define the instance method.

    Attributes:

    - ``key``: The identity key for the reference, calculated by the
      class's calculate_key method applied to the target instance method.

    - ``deletion_methods``: Sequence of callable objects taking single
      argument, a reference to this object which will be called when
      *either* the target object or target function is garbage
      collected (i.e. when this object becomes invalid).  These are
      specified as the on_delete parameters of safe_ref calls.

    - ``weak_self``: Weak reference to the target object.

    - ``weak_func``: Weak reference to the target function.

    Class Attributes:

    - ``_all_instances``: Class attribute pointing to all live
      BoundMethodWeakref objects indexed by the class's
      calculate_key(target) method applied to the target objects.
      This weak value dictionary is used to short-circuit creation so
      that multiple references to the same (object, function) pair
      produce the same BoundMethodWeakref instance.
    Ncsd|�|�}|j�|�}|dk	r.|j�|�|Stt|��|�}||j|<|j||f|�|�|SdS)a�Create new instance or return current instance.

        Basically this method of construction allows us to
        short-circuit creation of references to already- referenced
        instance methods.  The key corresponding to the target is
        calculated, and if there is already an existing reference,
        that is returned, with its deletion_methods attribute updated.
        Otherwise the new instance is created and registered in the
        table of already-referenced methods.
        N)	�
calculate_key�_all_instances�get�deletion_methods�append�superr�__new__�__init__)�clsr
rZ	argumentsZnamed�keyZcurrent�base��	__class__rrr|s

zBoundMethodWeakref.__new__cCsf|fdd�}|g|_|�|�|_t|�}t|�}t�||�|_t�||�|_t	|�|_
t	|j�|_dS)a�Return a weak-reference-like instance for a bound method.

        - ``target``: The instance-method target for the weak reference,
          must have im_self and im_func attributes and be
          reconstructable via the following, which is true of built-in
          instance methods::

            target.im_func.__get__( target.im_self )

        - ``on_delete``: Optional callback which will be called when
          this weak reference ceases to be valid (i.e. either the
          object or the function is garbage collected).  Should take a
          single argument, which will be passed a pointer to this
          object.
        cSs�|jdd�}|jdd�=z|jj|j=Wntk
r>YnX|D]n}zt|�rZ||�WqDtk
r�zt��Wn2t	k
r�t
��d}td|||f�YnXYqDXqDdS)z=Set self.isDead to True when method or instance is destroyed.N�z3Exception during saferef %s cleanup function %s: %s)
rr"rr�KeyErrorr�	Exception�	traceback�	print_excr�sys�exc_info�print)Zweak�self�methods�function�errr�remove�s$�z+BoundMethodWeakref.__init__.<locals>.removeN)
rrrr�get_funcrr�	weak_self�	weak_func�str�	self_name�__name__�	func_name)r+r
rr/r	r
rrrr�s
zBoundMethodWeakref.__init__cCstt|��tt|��fS)z�Calculate the reference key for this reference.

        Currently this is a two-tuple of the id()'s of the target
        object and the target function respectively.
        )�idrr0)rr
rrrr�sz BoundMethodWeakref.calculate_keycCsd|jj|j|jfS)z-Give a friendly representation of the object.z	%s(%s.%s))r"r5r4r6�r+rrr�__str__�s
�zBoundMethodWeakref.__str__cCs
|�dk	S)z'Whether we are still a valid reference.Nrr8rrr�__nonzero__�szBoundMethodWeakref.__nonzero__cCs*t||j�st|jt|��St|j|j�S)zCompare with another reference.)�
isinstancer"Zcmp�typer)r+�otherrrr�__cmp__�szBoundMethodWeakref.__cmp__cCs.|��}|dk	r*|��}|dk	r*|�|�SdS)a?Return a strong reference to the bound method.

        If the target cannot be retrieved, then will return None,
        otherwise returns a bound instance method for our object and
        function.

        Note: You may call this method any number of times, as it does
        not invalidate the reference.
        N)r1r2�__get__)r+r
r-rrrr�s

zBoundMethodWeakref.__call__)N)N)r5�
__module__�__qualname__�__doc__rZWeakValueDictionaryrrrr�classmethodr9�__repr__r:r>r�
__classcell__rrr!rrXs!
,r)N)rB�operatorr(r&rr�	NameError�version_info�
attrgetterrr0rrrrrrr�<module>#s






Filemanager

Name Type Size Permission Actions
__init__.cpython-38.opt-1.pyc File 374 B 0644
__init__.cpython-38.pyc File 374 B 0644
_saferef.cpython-38.opt-1.pyc File 6.87 KB 0644
_saferef.cpython-38.pyc File 7.03 KB 0644
_utilities.cpython-38.opt-1.pyc File 5.38 KB 0644
_utilities.cpython-38.pyc File 5.38 KB 0644
base.cpython-38.opt-1.pyc File 13.9 KB 0644
base.cpython-38.pyc File 13.94 KB 0644