https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/boto/mturk/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/boto/mturk/__pycache__/notification.cpython-310.pyc
o

ckF[b�@sldZddlZzddlmZWn
eyddlZYnwddlZddlZGdd�de�Z	Gdd�de�Z
dS)z�
Provides NotificationMessage and Event classes, with utility methods, for
implementations of the Mechanical Turk Notification API.
�N)�sha1c@s:eZdZdZdZdZdZdZe�	e�Z
dd�Zdd	�Zd
S)�NotificationMessagezlhttp://mechanicalturk.amazonaws.com/AWSMechanicalTurk/2006-05-05/AWSMechanicalTurkRequesterNotification.wsdlz
2006-05-05�&AWSMechanicalTurkRequesterNotification�Notifyz!Event\.(?P<n>\d+)\.(?P<param>\w+)cCs�|d|_|d|_|d|_|dtjksJdtj��g|_i}d|vr+|d}n0|D]-}||}|�d�rZtj�|��	�}t
|d�}t|d	�}||vrTi||<||||<q-|D]}|j�t
||��q]d
S)z
        Constructor; expects parameter d to be a dict of string parameters from a REST transport notification message
        �	Signature�	Timestamp�Version�methodzMethod should be '%s'�EventzEvent.�n�paramN)�	signature�	timestamp�versionr�OPERATION_NAME�events�
startswith�EVENT_RE�search�	groupdict�int�str�appendr
)�self�d�events_dict�k�v�edrr�r�9/usr/lib/python3/dist-packages/boto/mturk/notification.py�__init__.s*




��zNotificationMessage.__init__cCsJtj}|tj7}||j7}tj|td�}|�|�t�	|�
��}|j|kS)a
        Verifies the authenticity of a notification message.

        TODO: This is doing a form of authentication and
              this functionality should really be merged
              with the pluggable authentication mechanism
              at some point.
        )�key�	digestmod)r�SERVICE_NAMErr�hmac�new�sha�update�base64�	b64encode�digestr
)r�
secret_key�verification_input�h�signature_calcrrr �verifyJs	



zNotificationMessage.verifyN)
�__name__�
__module__�__qualname__�NOTIFICATION_WSDL�NOTIFICATION_VERSIONr$r�
EVENT_PATTERN�re�compilerr!r0rrrr r#s
rc@seZdZdd�Zdd�ZdS)r
cCsB|d|_|d|_|d|_|d|_d|vr|d|_dSdS)N�	EventType�	EventTime�	HITTypeId�HITId�AssignmentId)�
event_type�event_time_str�hit_type�hit_id�
assignment_id)rrrrr r!\s



�zEvent.__init__cCsd|j|jfS)Nz0<boto.mturk.notification.Event: %s for HIT # %s>)r>rA)rrrr �__repr__fszEvent.__repr__N)r1r2r3r!rCrrrr r
[s
r
)�__doc__r%�hashlibrr'�ImportErrorr)r7�objectrr
rrrr �<module>s�8

https://t.me/RX1948 - 2025