U
    Fc͆                     @   s   d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ ddlmZ dd	lmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z  G dd de!Z"dS )z2Twilio SendGrid v3/mail/send response body builder   )Bcc)Cc)Content)	CustomArg)DynamicTemplateData)Email)From)Header)MimeType)Personalization)ReplyTo)SendAt)Subject)Substitution)
TemplateId)Toc                   @   s@  e Zd ZdZdzddZdd Zd{d	d
Zdd Zdd Zdd Z	d|ddZ
edd Zd}ddZedd Zejd~ddZdddZedd ZejdddZddd Zed!d" Zejdd#d"Zdd$d%Zed&d' Zejd(d' Zed)d* Zed+d, Zejd-d, Zd.d/ Zed0d1 Zejd2d1 Zd3d4 Zed5d6 Zed7d8 Zejd9d8 Zd:d; Zed<d= Zejd>d= Zed?d@ ZejdAd@ ZedBdC Z e jdDdC Z edEdF Z!e!jdGdF Z!edHdI Z"edJdK Z#e#jdLdK Z#ddMdNZ$edOdP Z%edQdR Z&e&jdSdR Z&dTdU Z'edVdW Z(e(jdXdW Z(edYdZ Z)ed[d\ Z*e*jd]d\ Z*d^d_ Z+ed`da Z,edbdc Z-e-jdddc Z-dedf Z.edgdh Z/e/jdidh Z/edjdk Z0e0jdldk Z0edmdn Z1e1jdodn Z1edpdq Z2e2jdrdq Z2edsdt Z3e3jdudt Z3dvdw Z4e5dxdy Z6dS )Mailz*Creates the response body for v3/mail/sendNFc	           	      C   s   d| _ d| _d| _d| _d| _g | _d| _d| _d| _d| _	d| _
d| _d| _d| _d| _d| _d| _|dk	rt|| _|dk	r| ||| |dk	r|| _|dk	r| |tj |dk	r| |tj |dk	r| |tj dS )a  
        Creates the response body for a v3/mail/send API call

        :param from_email: The email address of the sender
        :type from_email: From, tuple, optional
        :param subject: The subject of the email
        :type subject: Subject, optional
        :param to_emails: The email address of the recipient
        :type to_emails: To, str, tuple, list(str), list(tuple),
                         list(To), optional
        :param plain_text_content: The plain text body of the email
        :type plain_text_content: string, optional
        :param html_content: The html body of the email
        :type html_content: string, optional
        :param amp_html_content: The amp-html body of the email
        :type amp_html_content: string, optional
        N)_attachments_categories	_contents_custom_args_headers_personalizations	_sections_asm	_batch_id_from_email_ip_pool_name_mail_settings	_reply_to_send_at_subject_template_id_tracking_settings
from_emailadd_tosubjectadd_contentr
   textamphtml)	selfr$   	to_emailsr&   Zplain_text_contentZhtml_contentZamp_html_contentglobal_substitutionsis_multiple r/   >/tmp/pip-unpacked-wheel-7j3043uk/sendgrid/helpers/mail/mail.py__init__   s:    zMail.__init__c                 C   s   t |  S )zA JSON-ready string representation of this Mail object.

        :returns: A JSON-ready string representation of this Mail object.
        :rtype: string
        )strgetr+   r/   r/   r0   __str__R   s    zMail.__str__    c                 C   s   |pg }| || |S )aZ  Ensure an item is appended to a list or create a new empty list

        :param new_items: the item(s) to append
        :type new_items: list(obj)
        :param append_to: the list on which to append the items
        :type append_to: list()
        :param index: index of the list on which to append the items
        :type index: int
        insert)r+   	new_itemsZ	append_toindexr/   r/   r0   _ensure_appendZ   s    
zMail._ensure_appendc                 C   s   |pg }| d| |S )a  Ensure an item is inserted to a list or create a new empty list

        :param new_items: the item(s) to insert
        :type new_items: list(obj)
        :param insert_to: the list on which to insert the items at index 0
        :type insert_to: list()
        r6   r7   )r+   r9   Z	insert_tor/   r/   r0   _ensure_inserth   s    zMail._ensure_insertc                 C   s&   t  }dd |pg D }dd |D S )z]Flatten a dict

        :param dicts: Flatten a dict
        :type dicts: list(dict)
        c                 S   s   g | ]}|  qS r/   r3   ).0dr/   r/   r0   
<listcomp>{   s     z'Mail._flatten_dicts.<locals>.<listcomp>c                 S   s$   i | ]}|  D ]\}}||qqS r/   )items)r>   r?   kvr/   r/   r0   
<dictcomp>|   s
     
   z'Mail._flatten_dicts.<locals>.<dictcomp>)dict)r+   Zdictsr?   Zlist_of_dictsr/   r/   r0   _flatten_dictst   s    zMail._flatten_dictsc                 C   s   |dk	r|  S dS )zGet the JSON representation of the object, else return None

        :param from_obj: Get the JSON representation of the object,
        else return None
        :type from_obj: obj
        Nr=   )r+   Zfrom_objr/   r/   r0   _get_or_none~   s    zMail._get_or_nonec           	      C   sJ  |dkrt |tr8|D ]}t }|| | | qnt }|| | | |dk	rt |tr|D ]}| jD ]}|| qrqhn| jD ]}|| qnz| j| }d}W n tk
r   t }d}Y nX t |tr|D ]}|| qn
|| |dk	r2t |tr(|D ]}|| qn
|| |sF| j||d dS )a  Adds emails to the Personalization object

        :param emails: An Email or list of Email objects
        :type emails: Email, list(Email)
        :param global_substitutions: A dict of substitutions for all recipients
        :type global_substitutions: dict
        :param is_multiple: Create a new personalization for each recipient
        :type is_multiple: bool
        :param p: p is the Personalization object or Personalization object
                  index
        :type p: Personalization, integer, optional
        TNFr:   )	
isinstancelistr   Z	add_emailadd_personalizationpersonalizationsadd_substitutionr   
IndexError)	r+   Zemailsr-   r.   pemailpersonalizationsubstitutionhas_internal_personalizationr/   r/   r0   _set_emails   sB    












zMail._set_emailsc                 C   s   | j S )z]A list of one or more Personalization objects

        :rtype: list(Personalization)
        )r   r4   r/   r/   r0   rL      s    zMail.personalizationsc                 C   s   |  || j|| _dS )zAdd a Personalization object

        :param personalization: Add a Personalization object
        :type personalization: Personalization
        :param index: The index where to add the Personalization
        :type index: int
        N)r;   r   )r+   rQ   r:   r/   r/   r0   rK      s
      zMail.add_personalizationc                 C   s   d S Nr/   r4   r/   r/   r0   to   s    zMail.toc                 C   s   t |trV|D ]D}t |tr&t|d}t |trBt|d |d }| |||| qn@t |trjt|d}t |trt|d |d }| |||| dS )a>  Adds To objects to the Personalization object

        :param to_emails: The email addresses of all recipients
        :type to_emails: To, str, tuple, list(str), list(tuple), list(To)
        :param global_substitutions: A dict of substitutions for all recipients
        :type global_substitutions: dict
        :param is_multiple: Create a new personalization for each recipient
        :type is_multiple: bool
        :param p: p is the Personalization object or Personalization object
                  index
        :type p: Personalization, integer, optional
        Nr6   r   )rI   rJ   r2   r   tupler%   )r+   r,   r-   r.   rO   rP   r/   r/   r0   rV      s    






c                 C   s   t |trl|D ]Z}t |tr(t|d}n0t |trFt|d |d }nt |tsXtd| |||| qnPt |trt|d}t |trt|d |d }t |tr|j}| |||| dS )a#  Adds a To object to the Personalization object

        :param to_email: A To object
        :type to_email: To, str, tuple, list(str), list(tuple), list(To)
        :param global_substitutions: A dict of substitutions for all recipients
        :type global_substitutions: dict
        :param is_multiple: Create a new personalization for each recipient
        :type is_multiple: bool
        :param p: p is the Personalization object or Personalization object
                  index
        :type p: Personalization, integer, optional
        Nr6   r   z<Please use a To/Cc/Bcc, tuple, or a str for a to_email list.)	rI   rJ   r2   r   rW   r   
ValueErrorrT   rQ   )r+   to_emailr-   r.   rO   rP   r/   r/   r0   r%      s$    







zMail.add_toc                 C   s   d S rU   r/   r4   r/   r/   r0   cc  s    zMail.ccc                 C   s   t |trV|D ]D}t |tr&t|d}t |trBt|d |d }| |||| qn@t |trjt|d}t |trt|d |d }| |||| dS )a  Adds Cc objects to the Personalization object

        :param cc_emails: An Cc or list of Cc objects
        :type cc_emails: Cc, list(Cc), tuple
        :param global_substitutions: A dict of substitutions for all recipients
        :type global_substitutions: dict
        :param is_multiple: Create a new personalization for each recipient
        :type is_multiple: bool
        :param p: p is the Personalization object or Personalization object
                  index
        :type p: Personalization, integer, optional
        Nr6   r   )rI   rJ   r2   r   rW   add_ccr   )r+   Z	cc_emailsr-   r.   rO   rP   r/   r/   r0   rZ     s    






c                 C   sV   t |trt|d}t |tr0t|d |d }t |tr@|j}| j||||d dS )a  Adds a Cc object to the Personalization object

        :param to_emails: An Cc object
        :type to_emails: Cc
        :param global_substitutions: A dict of substitutions for all recipients
        :type global_substitutions: dict
        :param is_multiple: Create a new personalization for each recipient
        :type is_multiple: bool
        :param p: p is the Personalization object or Personalization object
                  index
        :type p: Personalization, integer, optional
        Nr6   r   r.   rO   )rI   r2   r   rW   r   rQ   rT   )r+   cc_emailr-   r.   rO   r/   r/   r0   r[   6  s    



   zMail.add_ccc                 C   s   d S rU   r/   r4   r/   r/   r0   bccM  s    zMail.bccc                 C   s   t |trV|D ]D}t |tr&t|d}t |trBt|d |d }| |||| qn@t |trjt|d}t |trt|d |d }| |||| dS )a  Adds Bcc objects to the Personalization object

        :param bcc_emails: An Bcc or list of Bcc objects
        :type bcc_emails: Bcc, list(Bcc), tuple
        :param global_substitutions: A dict of substitutions for all recipients
        :type global_substitutions: dict
        :param is_multiple: Create a new personalization for each recipient
        :type is_multiple: bool
        :param p: p is the Personalization object or Personalization object
                  index
        :type p: Personalization, integer, optional
        Nr6   r   )rI   rJ   r2   r   rW   add_bcc)r+   Z
bcc_emailsr-   r.   rO   rP   r/   r/   r0   r^   Q  s    






c                 C   sV   t |trt|d}t |tr0t|d |d }t |tr@|j}| j||||d dS )a  Adds a Bcc object to the Personalization object

        :param to_emails: An Bcc object
        :type to_emails: Bcc
        :param global_substitutions: A dict of substitutions for all recipients
        :type global_substitutions: dict
        :param is_multiple: Create a new personalization for each recipient
        :type is_multiple: bool
        :param p: p is the Personalization object or Personalization object
                  index
        :type p: Personalization, integer, optional
        Nr6   r   r\   )rI   r2   r   rW   r   rQ   rT   )r+   	bcc_emailr-   r.   rO   r/   r/   r0   r_   r  s    



zMail.add_bccc                 C   s   | j S )z;The global Subject object

        :rtype: Subject
        )r!   r4   r/   r/   r0   r&     s    zMail.subjectc                 C   s|   t |trn|jdk	rfz| j|j }d}W n tk
rF   t }d}Y nX |j|_|sl| j||jd qx|| _n
t|| _dS )z|The subject of the email(s)

        :param value: The subject of the email(s)
        :type value: Subject, string
        NTFrH   )	rI   r   rQ   r   rN   r   r&   rK   r!   r+   valuerQ   rS   r/   r/   r0   r&     s"    



c                 C   s   | j S )zFA list of global Header objects

        :rtype: list(Header)
        )r   r4   r/   r/   r0   headers  s    zMail.headersc                 C   s   d S rU   r/   r4   r/   r/   r0   header  s    zMail.headerc                 C   s.   t |tr |D ]}| | qn
| | dS )zAdd headers to the email

        :param value: A list of Header objects or a dict of header key/values
        :type value: Header, list(Header), dict
        N)rI   rJ   
add_header)r+   rc   hr/   r/   r0   rd     s    
c                 C   s   |j dk	rz| j|j  }d}W n tk
r<   t }d}Y nX t|trnt| d \}}|t	|| n
|| |s| j
||j d nFt|trt| d \}}| t	||| j| _n| || j| _dS )zAdd headers to the email globaly or to a specific Personalization

        :param value: A Header object or a dict of header key/values
        :type value: Header, dict
        NTFr6   rH   )rQ   r   rN   r   rI   rE   rJ   rA   re   r	   rK   r;   r   )r+   rd   rQ   rS   rB   rC   r/   r/   r0   re     s0    





 zMail.add_headerc                 C   s   d S rU   r/   r4   r/   r/   r0   rR     s    zMail.substitutionc                 C   s.   t |tr |D ]}| | qn
| | dS )zAdd substitutions to the email

        :param value: Add substitutions to the email
        :type value: Substitution, list(Substitution)
        N)rI   rJ   rM   )r+   rR   sr/   r/   r0   rR     s    
c                 C   s   |j rZz| j|j  }d}W n tk
r8   t }d}Y nX || |s| j||j d nBt|tr|D ]}| jD ]}|| qrqhn| jD ]}|| qdS )zAdd a substitution to the email

        :param value: Add a substitution to the email
        :type value: Substitution
        TFrH   N)	rQ   r   rN   r   rM   rK   rI   rJ   rL   )r+   rR   rQ   rS   rg   rO   r/   r/   r0   rM     s(    


 


zMail.add_substitutionc                 C   s   | j S )zLA list of global CustomArg objects

        :rtype: list(CustomArg)
        r   r4   r/   r/   r0   custom_args  s    zMail.custom_argsc                 C   s   | j S rU   rh   r4   r/   r/   r0   
custom_arg!  s    zMail.custom_argc                 C   s.   t |tr |D ]}| | qn
| | dS )zAdd custom args to the email

        :param value: A list of CustomArg objects or a dict of custom arg
                      key/values
        :type value: CustomArg, list(CustomArg), dict
        N)rI   rJ   add_custom_arg)r+   rj   cr/   r/   r0   rj   %  s    
c                 C   s   |j dk	rz| j|j  }d}W n tk
r<   t }d}Y nX t|trnt| d \}}|t	|| n
|| |s| j
||j d nFt|trt| d \}}| t	||| j| _n| || j| _dS )zAdd custom args to the email globaly or to a specific Personalization

        :param value: A CustomArg object or a dict of custom arg key/values
        :type value: CustomArg, dict
        NTFr6   rH   )rQ   r   rN   r   rI   rE   rJ   rA   rk   r   rK   r;   r   )r+   rj   rQ   rS   rB   rC   r/   r/   r0   rk   3  s6    




 
  zMail.add_custom_argc                 C   s   | j S )z9The global SendAt object

        :rtype: SendAt
        )r    r4   r/   r/   r0   send_atS  s    zMail.send_atc                 C   s|   t |trn|jdk	rfz| j|j }d}W n tk
rF   t }d}Y nX |j|_|sl| j||jd qx|| _n
t|| _dS )zA unix timestamp specifying when your email should
        be delivered.

        :param value: A unix timestamp specifying when your email should
        be delivered.
        :type value: SendAt, int
        NTFrH   )	rI   r   rQ   r   rN   r   rm   rK   r    ra   r/   r/   r0   rm   [  s"    	



 c                 C   s   d S rU   r/   r4   r/   r/   r0   dynamic_template_dataw  s    zMail.dynamic_template_datac                 C   sf   t |tst|}z| j|j }d}W n tk
rD   t }d}Y nX |j|_|sb| j||jd dS )zData for a transactional template

        :param value: Data for a transactional template
        :type value: DynamicTemplateData, a JSON-serializable structure
        TFrH   N)rI   r   r   rQ   rN   r   rn   rK   ra   r/   r/   r0   rn   {  s    

 c                 C   s   | j S )z>The email address of the sender

        :rtype: From
        )r   r4   r/   r/   r0   r$     s    zMail.from_emailc                 C   s:   t |trt|d}t |tr0t|d |d }|| _dS )zThe email address of the sender

        :param value: The email address of the sender
        :type value: From, str, tuple
        Nr6   r   )rI   r2   r   rW   r   r+   rb   r/   r/   r0   r$     s
    


c                 C   s   | j S )z<The reply to email address

        :rtype: ReplyTo
        )r   r4   r/   r/   r0   reply_to  s    zMail.reply_toc                 C   s:   t |trt|d}t |tr0t|d |d }|| _dS )z~The reply to email address

        :param value: The reply to email address
        :type value: ReplyTo, str, tuple
        Nr6   r   )rI   r2   r   rW   r   ro   r/   r/   r0   rp     s
    


c                 C   s   | j S )zAThe contents of the email

        :rtype: list(Content)
        )r   r4   r/   r/   r0   contents  s    zMail.contentsc                 C   s   d S rU   r/   r4   r/   r/   r0   content  s    zMail.contentc                 C   s.   t |tr |D ]}| | qn
| | dS )zThe content(s) of the email

        :param contents: The content(s) of the email
        :type contents: Content, list(Content)
        N)rI   rJ   r'   )r+   rq   rl   r/   r/   r0   rr     s    
c                 C   s   t |trt||}|jtjkr2| || j| _n|jtjkr| jr|| jD ].}|jtjkrdd} qqJ|jtj	krJd} qqJnd}| j
|| j|d| _n*| jrt| j}nd}| j
|| j|d| _dS )zAdd content to the email

        :param contents: Content to be added to the email
        :type contents: Content
        :param mime_type: Override the mime type
        :type mime_type: MimeType, str
        r   r6   rH   N)rI   r2   r   	mime_typer
   r(   r<   r   r)   r*   r;   len)r+   rr   rs   _contentr:   r/   r/   r0   r'     s6    


  
  zMail.add_contentc                 C   s   | j S )zHThe attachments to this email

        :rtype: list(Attachment)
        )r   r4   r/   r/   r0   attachments  s    zMail.attachmentsc                 C   s   d S rU   r/   r4   r/   r/   r0   
attachment  s    zMail.attachmentc                 C   s.   t |tr |D ]}| | qn
| | dS )zAdd attachment(s) to this email

        :param attachment: Add attachment(s) to this email
        :type attachment: Attachment, list(Attachment)
        N)rI   rJ   add_attachment)r+   rw   ar/   r/   r0   rw     s    
c                 C   s   |  || j| _dS )zAdd an attachment to this email

        :param attachment: Add an attachment to this email
        :type attachment: Attachment
        N)r;   r   )r+   rw   r/   r/   r0   rx     s    zMail.add_attachmentc                 C   s   | j S )zQThe transactional template id for this email

        :rtype: TemplateId
        )r"   r4   r/   r/   r0   template_id  s    zMail.template_idc                 C   s    t |tr|| _n
t|| _dS )zThe transactional template id for this email

        :param value: The transactional template id for this email
        :type value: TemplateId
        N)rI   r   r"   ro   r/   r/   r0   rz     s    
c                 C   s   | j S )zXThe block sections of code to be used as substitutions

        :rtype: Section
        )r   r4   r/   r/   r0   sections+  s    zMail.sectionsc                 C   s   d S rU   r/   r4   r/   r/   r0   section3  s    zMail.sectionc                 C   s.   t |tr |D ]}| | qn
| | dS )zgThe block sections of code to be used as substitutions

        :rtype: Section, list(Section)
        N)rI   rJ   add_section)r+   r|   rf   r/   r/   r0   r|   7  s    
c                 C   s   |  || j| _dS )zA block section of code to be used as substitutions

        :param section: A block section of code to be used as substitutions
        :type section: Section
        N)r;   r   )r+   r|   r/   r/   r0   r}   C  s    zMail.add_sectionc                 C   s   | j S )zPThe categories assigned to this message

        :rtype: list(Category)
        )r   r4   r/   r/   r0   
categoriesK  s    zMail.categoriesc                 C   s   d S rU   r/   r4   r/   r/   r0   categoryS  s    zMail.categoryc                 C   s.   t |tr |D ]}| | qn
| | dS )zPAdd categories assigned to this message

        :rtype: list(Category)
        N)rI   rJ   add_category)r+   r~   rl   r/   r/   r0   r   W  s    
c                 C   s   |  || j| _dS )zJAdd a category assigned to this message

        :rtype: Category
        N)r;   r   )r+   r   r/   r/   r0   r   c  s    zMail.add_categoryc                 C   s   | j S )z=The batch id for this email

        :rtype: BatchId
        r   r4   r/   r/   r0   batch_idj  s    zMail.batch_idc                 C   s
   || _ dS )ztThe batch id for this email

        :param value: The batch id for this email
        :type value: BatchId
        Nr   ro   r/   r/   r0   r   r  s    c                 C   s   | j S )zHAn object specifying unsubscribe behavior.

        :rtype: Asm
        r   r4   r/   r/   r0   asm{  s    zMail.asmc                 C   s
   || _ dS )zAn object specifying unsubscribe behavior.

        :param value: An object specifying unsubscribe behavior.
        :type value: Asm
        Nr   ro   r/   r/   r0   r     s    c                 C   s   | j S )z\The IP Pool that you would like to send this email from

        :rtype: IpPoolName
        r   r4   r/   r/   r0   ip_pool_name  s    zMail.ip_pool_namec                 C   s
   || _ dS )zThe IP Pool that you would like to send this email from

        :paran value: The IP Pool that you would like to send this email from
        :type value: IpPoolName
        Nr   ro   r/   r/   r0   r     s    c                 C   s   | j S )zGThe mail settings for this email

        :rtype: MailSettings
        r   r4   r/   r/   r0   mail_settings  s    zMail.mail_settingsc                 C   s
   || _ dS )zThe mail settings for this email

        :param value: The mail settings for this email
        :type value: MailSettings
        Nr   ro   r/   r/   r0   r     s    c                 C   s   | j S )zOThe tracking settings for this email

        :rtype: TrackingSettings
        r#   r4   r/   r/   r0   tracking_settings  s    zMail.tracking_settingsc                 C   s
   || _ dS )zThe tracking settings for this email

        :param value: The tracking settings for this email
        :type value: TrackingSettings
        Nr   ro   r/   r/   r0   r     s    c                 C   s   |  | j|  | jdd | jp"g D dd | jp4g D dd | jpFg D |  | j| | j| | j	dd | j
pvg D | | j|  | j|  | j|  | j|  | j|  | j|  | j|  | jd}dd | D S )	z
        Get a JSON-ready representation of this Mail object.

        :returns: This Mail object, ready for use in a request body.
        :rtype: dict
        c                 S   s   g | ]}|  qS r/   r=   )r>   rO   r/   r/   r0   r@     s     zMail.get.<locals>.<listcomp>c                 S   s   g | ]}|  qS r/   r=   r>   rl   r/   r/   r0   r@     s     c                 S   s   g | ]}|  qS r/   r=   )r>   ry   r/   r/   r0   r@     s     c                 S   s   g | ]}|  qS r/   r=   r   r/   r/   r0   r@     s     )fromr&   rL   rr   rv   rz   r{   rc   r~   ri   rm   r   r   r   r   r   rp   c                 S   s.   i | ]&\}}|d k	r|g kr|i kr||qS rU   r/   )r>   keyrb   r/   r/   r0   rD     s       zMail.get.<locals>.<dictcomp>)rG   r$   r&   rL   rq   rv   rz   rF   r{   rc   r~   ri   rm   r   r   r   r   r   rp   rA   )r+   mailr/   r/   r0   r3     s&    












zMail.getc                 C   s   | t |d|dt |dd}z| }W n tk
rP   | }Y nX |t| |  |	 D ]\}}|
t|| qr|S )zCreate a Mail object from an instance of
        email.message.EmailMessage.

        :type message: email.message.EmailMessage
        :rtype: Mail
        r   r   r   )r$   r&   r,   )r   r3   get_contentAttributeErrorget_payloadr'   r   get_content_typestriprA   re   r	   )clsmessager   bodyrB   rC   r/   r/   r0   from_EmailMessage  s     zMail.from_EmailMessage)NNNNNNNF)r6   )NFr6   )r6   )NFr6   )NFr6   )NFr6   )NFr6   )NFr6   )NFr6   )N)7__name__
__module____qualname____doc__r1   r5   r;   r<   rF   rG   rT   propertyrL   rK   rV   setterr%   rZ   r[   r^   r_   r&   rc   rd   re   rR   rM   ri   rj   rk   rm   rn   r$   rp   rq   rr   r'   rv   rw   rx   rz   r{   r|   r}   r~   r   r   r   r   r   r   r   r3   classmethodr   r/   r/   r/   r0   r      s          
;


     
9


     
#
     

   #   





 




 











#




















r   N)#r   r`   r   r]   r   rr   r   rj   r   rn   r   rP   r   r$   r   rd   r	   rs   r
   rQ   r   rp   r   rm   r   r&   r   rR   r   rz   r   rY   r   objectr   r/   r/   r/   r0   <module>   s"   