o
    ”ôjY¯  ã                   @  sÀ  d dl mZ d dlT d dlT d dlmZ d dlmZmZ d dlm	Z	m
Z
mZmZmZ d dlmZmZmZmZmZmZmZmZmZ d dlmZmZmZmZ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&Z&d dl'Z'd dl(Z(d dl)Z)d dl*Z*	 g d¢Z2G dd„ de3ƒZ4G dd„ dƒZ5G dd„ de5ƒZ6e6 7e8dƒe6j9¡ e6 7e:e6j;¡ e6 7e<e6j=¡ e6 7e>e6j?¡ e6 7e@e6jA¡ e6 7eBe6jC¡ e6 7eDe6jE¡ e6 7eFe6jE¡ e6 7eGe6jH¡ e6 7eIe6jJ¡ e6 7ee6jK¡ e6 7e&jLe6jK¡ e6 7e'jMe6jN¡ e6 7e'j'e6jO¡ e6 7de6jP¡ G dd„ de6ƒZQeQ 7eReQjS¡ eQ 7eFeQjT¡ eQ 7e8eQjU¡ eQ 7e(jVeQjU¡ eQ 7e(jWeQjU¡ eQ 7e(jXeQjY¡ eQ Ze[eQj\¡ eQ Ze8eQjU¡ G dd„ de6ƒZ]e] 7e8dƒe]j9¡ e] 7e	e]j^¡ e] 7e
e]j_¡ e] 7ee]j`¡ e] 7ee]ja¡ e] 7ee]jb¡ e] 7ee]jc¡ e] 7ee]jd¡ e] 7ee]je¡ e] 7ee]jf¡ e] 7ee]jg¡ e] 7ee]jh¡ e] 7e!e]ji¡ e] 7ee]jE¡ e] 7ee]jH¡ e] 7ee]jK¡ e] 7e&jLe]jK¡ e] 7ee]jJ¡ e] 7ee]jj¡ e] 7e#e]jO¡ dS )é    )Úannotations)Ú*)Úordereddict)ÚnprintÚnprintf)ÚLiteralScalarStringÚFoldedScalarStringÚSingleQuotedScalarStringÚDoubleQuotedScalarStringÚPlainScalarString)	ÚCommentedMapÚCommentedOrderedMapÚCommentedSeqÚCommentedKeySeqÚCommentedKeyMapÚCommentedSetÚcomment_attribÚmerge_attribÚTaggedScalar)Ú	ScalarIntÚ	BinaryIntÚOctalIntÚHexIntÚ
HexCapsInt)ÚScalarFloat)ÚScalarBoolean)Ú	TimeStamp)ÚAnchorNF)ÚDictÚListÚAnyÚUnionÚTextÚOptional)ÚBaseRepresenterÚSafeRepresenterÚRepresenterÚRepresenterErrorÚRoundTripRepresenterc                   @  s   e Zd ZdS )r'   N)Ú__name__Ú
__module__Ú__qualname__© r,   r,   új/var/www/html/academy/tools/voices/clone/cosy-venv/lib/python3.10/site-packages/ruamel/yaml/representer.pyr'   0   s    r'   c                   @  s¾   e Zd ZU i Zded< i Zded< 			d3d4dd„Zed5dd„ƒZd6dd„Z	d7dd„Z
d7dd„Zed8dd„ƒZed8dd„ƒZ	d9d:d"d#„Z	d;d<d'd(„Zd;d=d*d+„Zd;d>d.d/„Zd?d1d2„ZdS )@r$   zDict[Any, Any]Úyaml_representersÚyaml_multi_representersNÚselfr    Údefault_styleÚdefault_flow_styleÚdumperÚreturnÚNonec                 C  s@   || _ | j d ur| | j _|| _|| _i | _g | _d | _d| _d S )NT)r3   Ú_representerr1   r2   Úrepresented_objectsÚobject_keeperÚ	alias_keyÚ sort_base_mapping_type_on_output©r0   r1   r2   r3   r,   r,   r-   Ú__init__9   s   

zBaseRepresenter.__init__c                 C  s8   zt | jdƒr| jjW S | jjW S  ty   |  Y S w )NÚtyp)Úhasattrr3   Ú
serializerÚ_serializerÚAttributeError)r0   r,   r,   r-   r?   I   s   

ÿzBaseRepresenter.serializerÚdatac                 C  s,   |   |¡}| j |¡ i | _g | _d | _d S ©N)Úrepresent_datar?   Ú	serializer7   r8   r9   )r0   rB   Únoder,   r,   r-   Ú	representR   s
   

zBaseRepresenter.representc                 C  sö   |   |¡r	d | _nt|ƒ| _| jd ur'| j| jv r!| j| j }|S | j |¡ t|ƒj}|d | jv r?| j|d  | |ƒ}|S |D ]}|| j	v rS| j	| | |ƒ} |S qAd | j	v rc| j	d  | |ƒ}|S d | jv rr| jd  | |ƒ}|S t
d t|ƒƒ}|S )Nr   )Úignore_aliasesr9   Úidr7   r8   ÚappendÚtypeÚ__mro__r.   r/   Ú
ScalarNodeÚstr)r0   rB   rF   Ú
data_typesÚ	data_typer,   r,   r-   rD   Y   s4   



ó

ô

úýzBaseRepresenter.represent_datac                 C  s
   |   |¡S )a  
        David Fraser: Extract a method to represent keys in mappings, so that
        a subclass can choose not to quote them (for example)
        used in represent_mapping
        https://bitbucket.org/davidfraser/pyyaml/commits/d81df6eb95f20cac4a79eed95ae553b5c6f77b8c
        )rD   ©r0   rB   r,   r,   r-   Úrepresent_keyz   s   
zBaseRepresenter.represent_keyrP   Úrepresenterc                 C  ó$   d| j vr| j ¡ | _|| j|< d S )Nr.   )Ú__dict__r.   Úcopy©ÚclsrP   rS   r,   r,   r-   Úadd_representerƒ   ó   
zBaseRepresenter.add_representerc                 C  rT   )Nr/   )rU   r/   rV   rW   r,   r,   r-   Úadd_multi_representer‰   rZ   z%BaseRepresenter.add_multi_representerÚtagÚvalueÚstyleÚanchorrM   c                 C  s|   |d u r| j }d }|r|d dv rt|dd ƒ}|rd |gg}t|tƒr(t|d�}t|||||d�}| jd ur<|| j| j< |S )Nr   z|>Úcomment©Úsuffix)r^   r`   r_   )r1   ÚgetattrÚ
isinstancerN   ÚTagrM   r9   r7   )r0   r\   r]   r^   r_   r`   rF   r,   r,   r-   Úrepresent_scalar�   s   



z BaseRepresenter.represent_scalarÚsequenceÚ
flow_styleÚSequenceNodec           	      C  sš   g }t |tƒrt|d�}t|||d�}| jd ur|| j| j< d}|D ]}|  |¡}t |tƒr1|jr3d}| 	|¡ q"|d u rK| j
d urH| j
|_|S ||_|S )Nra   ©rh   TF)rd   rN   re   ri   r9   r7   rD   rM   r^   rJ   r2   rh   )	r0   r\   rg   rh   r]   rF   Ú
best_styleÚitemÚ	node_itemr,   r,   r-   Úrepresent_sequence    s$   




ÿz"BaseRepresenter.represent_sequenceÚomapc           
      C  s’   g }t |tƒrt|d�}t|||d�}| jd ur|| j| j< d}|D ]}|| }|  ||i¡}	| |	¡ q"|d u rG| jd urD| j|_	|S ||_	|S )Nra   rj   T)
rd   rN   re   ri   r9   r7   rD   rJ   r2   rh   )
r0   r\   ro   rh   r]   rF   rk   Úitem_keyÚitem_valrm   r,   r,   r-   Úrepresent_omap¶   s"   



ÿzBaseRepresenter.represent_omapÚmappingÚMappingNodec                 C  sü   g }t |tƒrt|d�}t|||d�}| jd ur|| j| j< d}t|dƒr>t| ¡ ƒ}| j	r>zt
|ƒ}W n	 ty=   Y nw |D ])\}}|  |¡}	|  |¡}
t |	tƒrV|	jrXd}t |
tƒr`|
jrbd}| |	|
f¡ q@|d u r|| jd ury| j|_|S ||_|S )Nra   rj   TÚitemsF)rd   rN   re   rt   r9   r7   r>   Úlistru   r:   ÚsortedÚ	TypeErrorrR   rD   rM   r^   rJ   r2   rh   )r0   r\   rs   rh   r]   rF   rk   rp   Ú
item_valueÚnode_keyÚ
node_valuer,   r,   r-   Úrepresent_mappingÌ   s:   



ÿ


ÿz!BaseRepresenter.represent_mappingÚboolc                 C  s   dS ©NFr,   rQ   r,   r,   r-   rH   ê   s   zBaseRepresenter.ignore_aliases©NNN)
r0   r    r1   r    r2   r    r3   r    r4   r5   )r4   r    ©rB   r    r4   r5   ©rB   r    r4   r    )rP   r    rS   r    r4   r5   )NN)
r\   r    r]   r    r^   r    r_   r    r4   rM   rC   ©r\   r    rg   r    rh   r    r4   ri   ©r\   r    ro   r    rh   r    r4   ri   ©r\   r    rs   r    rh   r    r4   rt   ©rB   r    r4   r}   )r)   r*   r+   r.   Ú__annotations__r/   r<   Úpropertyr?   rG   rD   rR   ÚclassmethodrY   r[   rf   rn   rr   r|   rH   r,   r,   r,   r-   r$   4   s.   
 ü


!	ÿÿr$   c                   @  sÜ   e Zd Zd.dd„Zd/dd	„Zd0d
d„Zd/dd„Zd1d2dd„Zd/dd„ZdZ	e
e	ƒe
e	e	 ƒkr=e	e	9 Z	e
e	ƒe
e	e	 ƒks/d/dd„Zd3dd„Zd4dd„Zd3dd„Zd4d d!„Zd/d"d#„Zd/d$d%„Z	d1d5d)d*„Zd6d,d-„ZdS )7r%   rB   r    r4   r}   c                 C  s:   |d u st |tƒr|dkrdS t |tttttfƒrdS dS )Nr,   TF)rd   ÚtupleÚbytesrN   r}   ÚintÚfloatrQ   r,   r,   r-   rH   ï   s
   zSafeRepresenter.ignore_aliasesrM   c                 C  s   |   dd¡S )Nútag:yaml.org,2002:nullÚnull©rf   rQ   r,   r,   r-   Úrepresent_noneù   ó   zSafeRepresenter.represent_nonec                 C  ó   |   d|¡S )Nútag:yaml.org,2002:strr�   rQ   r,   r,   r-   Úrepresent_strü   r‘   zSafeRepresenter.represent_strc                 C  s<   t tdƒrt |¡ d¡}nt |¡ d¡}| jd|dd�S )NÚencodebytesÚasciiztag:yaml.org,2002:binaryú|)r^   )r>   Úbase64r•   ÚdecodeÚencodestringrf   rQ   r,   r,   r-   Úrepresent_binaryÿ   s   
z SafeRepresenter.represent_binaryNr_   úOptional[Any]c                 C  sF   z
| j jt|ƒ }W n ty   |rd}nd}Y nw | jd||d�S )NÚtrueÚfalseztag:yaml.org,2002:bool©r_   )r3   Zboolean_representationr}   rA   rf   )r0   rB   r_   r]   r,   r,   r-   Úrepresent_bool  s   €üzSafeRepresenter.represent_boolc                 C  s   |   dt|ƒ¡S )Nútag:yaml.org,2002:int)rf   rN   rQ   r,   r,   r-   Úrepresent_int  s   zSafeRepresenter.represent_intgœu ˆ<ä7~c                 C  sˆ   ||ks|dkr|dkrd}n/|| j krd}n'|| j  kr d}nt|ƒ ¡ }t| jdd ƒdkr>d|vr>d	|v r>| d	d
d¡}|  d|¡S )Nç        ç      ð?ú.nanú.infú-.infÚuse_version©é   rª   Ú.Úez.0erª   útag:yaml.org,2002:float)Ú	inf_valueÚreprÚlowerrc   r?   Úreplacerf   ©r0   rB   r]   r,   r,   r-   Úrepresent_float  s   
zSafeRepresenter.represent_floatri   c                 C  r’   )Nútag:yaml.org,2002:seq©rn   rQ   r,   r,   r-   Úrepresent_list-  s   zSafeRepresenter.represent_listrt   c                 C  r’   )Nútag:yaml.org,2002:map©r|   rQ   r,   r,   r-   Úrepresent_dict=  r‘   zSafeRepresenter.represent_dictc                 C  r’   )Nztag:yaml.org,2002:omap)rr   rQ   r,   r,   r-   Úrepresent_ordereddict@  r‘   z%SafeRepresenter.represent_ordereddictc                 C  s"   i }|D ]}d ||< q|   d|¡S )Nútag:yaml.org,2002:setr¸   )r0   rB   r]   Úkeyr,   r,   r-   Úrepresent_setC  s   
zSafeRepresenter.represent_setc                 C  s   |  ¡ }|  d|¡S )Nútag:yaml.org,2002:timestamp©Ú	isoformatrf   r²   r,   r,   r-   Úrepresent_dateI  s   zSafeRepresenter.represent_datec                 C  s   |  d¡}|  d|¡S )Nú r¾   r¿   r²   r,   r,   r-   Úrepresent_datetimeM  s   
z"SafeRepresenter.represent_datetimer\   rX   rh   c                 C  s.   t |dƒr
| ¡ }n|j ¡ }| j|||d�S ©NÚ__getstate__rj   )r>   rÅ   rU   rV   r|   )r0   r\   rB   rX   rh   Ústater,   r,   r-   Úrepresent_yaml_objectQ  s   


z%SafeRepresenter.represent_yaml_objectr5   c                 C  s   t d|›�ƒ‚)Nzcannot represent an object: )r'   rQ   r,   r,   r-   Úrepresent_undefinedZ  s   z#SafeRepresenter.represent_undefinedr…   ©rB   r    r4   rM   r�   rC   )rB   r    r_   rœ   r4   rM   ©rB   r    r4   ri   ©rB   r    r4   rt   )
r\   r    rB   r    rX   r    rh   r    r4   rt   r€   )r)   r*   r+   rH   r�   r”   r›   r    r¢   r®   r¯   r³   r¶   r¹   rº   r½   rÁ   rÃ   rÇ   rÈ   r,   r,   r,   r-   r%   î   s*    






ÿ






ÿ	r%   c                   @  s>   e Zd Zddd„Zddd„Zdd
d„Zddd„Zddd„ZdS )r&   rB   r    r4   c                 C  sl   |j dkrt|jƒ}n%|jdkr|j ›d�}n|j dkr'|j›d|j ›d�}n	|j›|j ›d�}|  d|¡S )Nr£   Újr   ú+z tag:yaml.org,2002:python/complex)Úimagr¯   Úrealrf   rQ   r,   r,   r-   Úrepresent_complex€  s   


zRepresenter.represent_complexri   c                 C  r’   )Nztag:yaml.org,2002:python/tuplerµ   rQ   r,   r,   r-   Úrepresent_tuple‹  r‘   zRepresenter.represent_tuplerM   c                 C  sL   z|j ›d|j›�}W n ty   |j ›d|j›�}Y nw |  d| d¡S )Nr«   ztag:yaml.org,2002:python/name:Ú )r*   r+   rA   r)   rf   )r0   rB   Únamer,   r,   r-   Úrepresent_nameŽ  s   þzRepresenter.represent_namec                 C  s   |   d|j d¡S )Nz tag:yaml.org,2002:python/module:rÒ   )rf   r)   rQ   r,   r,   r-   Úrepresent_module–  s   zRepresenter.represent_moduleú Union[SequenceNode, MappingNode]c                 C  sÀ  t |ƒ}|tjv rtj| |ƒ}nt|dƒr| d¡}nt|dƒr&| ¡ }ntd|›�ƒ‚t|ƒd gd  d d… }|\}}}}}t|ƒ}|d u rKi }|d urSt|ƒ}|d ur[t|ƒ}|j	dkro|d }|dd … }d	}	d
}
nd}	d}
z|j
›d|j›�}W n ty�   |j
›d|j	›�}Y nw |s¦|s¦|s¦t|tƒr¦|
r¦|  d| |¡S |s¹|s¹t|tƒr¹|s¹|  |	| |¡S i }|rÁ||d< |sÈt|tƒsÌ||d< |rÒ||d< |rØ||d< |  |	| |¡S )NÚ__reduce_ex__é   Ú
__reduce__zcannot represent object: é   Ú
__newobj__r   rª   z$tag:yaml.org,2002:python/object/new:Tz&tag:yaml.org,2002:python/object/apply:Fr«   z tag:yaml.org,2002:python/object:ÚargsrÆ   Ú	listitemsÚ	dictitems)rK   ÚcopyregÚdispatch_tabler>   r×   rÙ   r'   rv   Údictr)   r*   r+   rA   rd   r|   rn   )r0   rB   rX   ÚreduceÚfunctionrÜ   rÆ   rÝ   rÞ   r\   ÚnewobjÚfunction_namer]   r,   r,   r-   Úrepresent_object™  sZ   




þÿzRepresenter.represent_objectNr�   rÊ   rÉ   )rB   r    r4   rÖ   )r)   r*   r+   rÐ   rÑ   rÔ   rÕ   ræ   r,   r,   r,   r-   r&     s    



r&   c                   @  s2  e Zd Z	dQdRdd	„ZdSdd„ZdTdd„ZdTdd„ZeZdTdd„ZdTdd„Z	dTdd„Z
dTdd„Z	dUdVdd „ZdTd!d"„ZdTd#d$„ZdTd%d&„ZdTd'd(„ZdTd)d*„ZdTd+d,„Z	dUdWd1d2„ZdXd5d6„ZdYd7d8„ZdUdZd;d<„ZdUd[d>d?„Zd\dAdB„Zd]dCdD„Zd^dEdF„ZdTdGdH„ZdTdIdJ„ZdTdKdL„Z	dUd_dOdP„ZdS )`r(   Nr1   r    r2   r3   r4   r5   c                 C  s,   t |dƒs|d u rd}tj| |||d� d S )Nr=   F)r1   r2   r3   )r>   r%   r<   r;   r,   r,   r-   r<   ð  s   
üzRoundTripRepresenter.__init__rB   r}   c                 C  s@   z|j d ur|j jd urW dS W n	 ty   Y nw t | |¡S r~   )r_   r]   rA   r%   rH   rQ   r,   r,   r-   rH   ü  s   €ÿz#RoundTripRepresenter.ignore_aliasesrM   c                 C  s.   t | jƒdkr| jjs|  dd¡S |  dd¡S )Nr   r�   rŽ   rÒ   )Úlenr7   r?   Úuse_explicit_startrf   rQ   r,   r,   r-   r�     s   z#RoundTripRepresenter.represent_nonec                 C  ó*   d }d}|j dd�}d}| j||||d�S )Nr—   T©Úanyr“   ©r^   r_   ©Úyaml_anchorrf   ©r0   rB   r\   r^   r_   r,   r,   r-   Úrepresent_literal_scalarstring
  ó
   z3RoundTripRepresenter.represent_literal_scalarstringc                 C  sœ   d }d}|j dd�}tt|dg ƒƒD ]0}|| dkrB|dkrB||d   ¡ sB|t|ƒk rB||d   ¡ sB|d |… d ||d …  }qd	}| j||||d
�S )Nú>Trê   Úfold_posrÂ   r   rª   úr“   rì   )rî   Úreversedrc   Úisspacerç   rf   )r0   rB   r\   r^   r_   ró   r,   r,   r-   Úrepresent_folded_scalarstring  s   €z2RoundTripRepresenter.represent_folded_scalarstringc                 C  ré   )Nú'Trê   r“   rì   rí   rï   r,   r,   r-   Ú$represent_single_quoted_scalarstring!  rñ   z9RoundTripRepresenter.represent_single_quoted_scalarstringc                 C  ré   )Nú"Trê   r“   rì   rí   rï   r,   r,   r-   Ú$represent_double_quoted_scalarstring(  rñ   z9RoundTripRepresenter.represent_double_quoted_scalarstringc                 C  ré   )NrÒ   Trê   r“   rì   rí   rï   r,   r,   r-   Úrepresent_plain_scalarstring/  rñ   z1RoundTripRepresenter.represent_plain_scalarstringÚprefixÚsÚ
underscorer_   c                 C  s¢   |d u r| j d|| |d�S |d r7t|ƒ}t|ƒ|d  }|dkr2| |d¡ ||d 8 }|dks"d |¡}|d r?d| }|d rG|d7 }| j d|| |d�S )Nr¡   rŸ   r   Ú_rÒ   rª   rØ   )rf   rv   rç   ÚinsertÚjoin)r0   rý   rþ   rÿ   r_   ÚslÚposr,   r,   r-   Úinsert_underscore6  s   þ
z&RoundTripRepresenter.insert_underscorec                 C  óH   |j d ur|d|j › d�›}nt|dƒ}|jdd�}| jd||j|d�S )NÚ0ÚdTrê   rÒ   rŸ   ©Ú_widthÚformatrî   r  Ú_underscore©r0   rB   rþ   r_   r,   r,   r-   Úrepresent_scalar_intH  s
   

z)RoundTripRepresenter.represent_scalar_intc                 C  r  )Nr  ÚbTrê   Ú0brŸ   r	  r  r,   r,   r-   Úrepresent_binary_intP  ó
   

z)RoundTripRepresenter.represent_binary_intc                 C  sb   |j d ur|d|j › d�›}nt|dƒ}|jdd�}d}t| jdd ƒdkr'd}| j|||j|d�S )	Nr  ÚoTrê   Ú0or¨   r©   rŸ   )r
  r  rî   rc   r?   r  r  )r0   rB   rþ   r_   rý   r,   r,   r-   Úrepresent_octal_intY  s   

z(RoundTripRepresenter.represent_octal_intc                 C  r  )Nr  ÚxTrê   Ú0xrŸ   r	  r  r,   r,   r-   Úrepresent_hex_inte  r  z&RoundTripRepresenter.represent_hex_intc                 C  r  )Nr  ÚXTrê   r  rŸ   r	  r  r,   r,   r-   Úrepresent_hex_caps_intn  r  z+RoundTripRepresenter.represent_hex_caps_intc                 C  sD  d}|j dd�}||ks|dkr|dkrd}n|| jkrd}n|| j kr'd}|r1| jd	||d
�S |jdu rW|jdkrW|j|jd krW|jrI|jnd› tt|ƒƒd›d�}�n¸|jdu rÀ|j}|jre|jnd}|dk r€|› tt|ƒƒd|jt	|ƒ › d�›�}n,|› t|ƒd|jt	|ƒ › d|j| d › d�›�}|dks¦|dkr¬|dkr¬| 
dd¡}t	|ƒ|jk r¾|d7 }t	|ƒ|jk s³�nO||j› d|j|jrÌdnd › d�› d¡\}}|jdkrà|jn|jd }|dk rí|d7 }|d|… }t|ƒ}	| d¡\}
}t	|
ƒt	|ƒ |j|jdk�rdnd k �r.|d7 }t	|
ƒt	|ƒ |j|jdk�r)dnd k �s|j�r;|dk�r;d|
 }
|j�rAdnd}|jdk �rš|dk�rU|	t	|ƒ8 }	nd}t	|
ƒt	|ƒ |j�rddnd |jk �r‡|d7 }|	d8 }	t	|
ƒt	|ƒ |j�r€dnd |jk �sk|
| |j |	|› d|j› d�› }nu|jdk�r»|	t	|ƒ8 }	|
| d |j |	|› d|j› d�› }nT|jdk�rÛd|jd  |
 | }d}
|d|j … }|	|j7 }	t	|
ƒ|jk �rû|
|d 7 }
|dd… }|	d8 }	t	|
ƒ|jk �sã|
d | |j |	|› d|j› d�› }|du �rt|ƒ ¡ }| jd	||d
�S )z this is way more complicated NTrê   r£   r¤   r¥   r¦   r§   r­   rŸ   r   rª   rÒ   r  r«   r  Úfz0.r¬   rÍ   )rî   r®   rf   Ú_expÚ_precr
  Ú_m_signÚabsr‹   rç   r±   ÚsplitÚ_e_signÚ_e_widthÚ_m_lead0r¯   r°   )r0   rB   r]   r_   ÚprecÚmsÚmÚesÚwr¬   Úm1Úm2Zesgnr,   r,   r-   Úrepresent_scalar_floatw  s„   
$(
*4ÿ€*ý,,ÿ
((þ&*
ý(
z+RoundTripRepresenter.represent_scalar_floatr\   rg   rh   ri   c                 C  sê  g }z|j  |¡}W n ty   |}Y nw z| ¡ }W n ty'   d }Y nw t|tƒr2t|d�}t||||d�}| jd urE|| j	| j< d}zbt
|tƒ}|j|_|jre|jd re|jd D ]}	|	 ¡  q^|j}
|
 ¡ D ]}|r|d r|d D ]}	|	 ¡  qxql|j}
|jd u r�|j|_n|jd d … |_z	|j |j¡ W n	 ty§   Y nw W n ty´   i }
Y nw t|ƒD ]!\}}|  |¡}|  ||
 |¡¡ t|tƒrÓ|jrÕd}| |¡ q¹|d u rót|ƒdkrð| jd urð| j|_|S ||_|S )Nra   ©rh   r_   Trª   Fr   )Úfarh   rA   rî   rd   rN   re   ri   r9   r7   rc   r   r`   Úresetru   ÚvaluesrJ   ÚendÚ	enumeraterD   Úmerge_commentsÚgetrM   r^   rç   r2   )r0   r\   rg   rh   r]   r_   rF   rk   r`   ÚctÚitem_commentsÚvÚidxrl   rm   r,   r,   r-   rn   À  sl   ÿÿ





€

ÿ€ÿ
ÿz'RoundTripRepresenter.represent_sequencerF   Úcommentsc                 C  s„   |d u rt |dƒsJ ‚|S t|dd ƒd ur=t|ƒD ]#\}}|t|jƒkr%q|j| }|d ur<|d u s8||ks8J ‚|||< q||_|S )Nr`   )r>   rc   r1  rç   r`   )r0   rF   r8  r7  ÚvalÚncr,   r,   r-   r2  ú  s   
€z#RoundTripRepresenter.merge_commentsc                 C  sL   t |tƒrd | _| jd|dd�S t |tƒr d | _| jd|dd�S t | |¡S )Nr´   Trj   r·   )rd   r   r9   rn   r   r|   r%   rR   rQ   r,   r,   r-   rR   	  s   

z"RoundTripRepresenter.represent_keyrs   rt   c              	   C  s  g }z|j  |¡}W n ty   |}Y nw z| ¡ }W n ty'   d }Y nw t|tƒr2t|d�}t||||d�}| jd urE|| j	| j< d}zbt
|tƒ}|jd u rW|j|_n|jd d … |_|jrs|jd rs|jd D ]}	|	 ¡  ql|j}
| jjd u r§|
 ¡ D ]}|r“|d r“|d D ]}	|	 ¡  qŒq€z	|j |j¡ W n
 ty¦   Y nw 	 W n ty´   i }
Y nw t
|tg ƒ}z|j}W n ttfyÍ   d}Y nw d}t|ƒdkrÛ| ¡ }n| ¡ }|D ]_\}}|d7 }|  |¡}|  |¡}|
 |¡}|�r!|d d… |_t
|dd ƒ}|d u�r|d |d< |d |d< n|dd … |_t|tƒ�r+|j�r-d	}t|tƒ�r7|j�r9d	}| ||f¡ qá|d u �r`|dk�sRt|ƒdk�r]| jd u�r]| j|_n||_t|ƒdk�r‰|jd u �ru|  |d ¡}n|  |j¡}|  |ttd
d�dƒ|f¡ |S )Nra   r,  Trª   r   rØ   r`   é   Fztag:yaml.org,2002:mergez<<)!r-  rh   rA   rî   rd   rN   re   rt   r9   r7   rc   r   r`   r.  ru   r3   Úcomment_handlingr/  rJ   r0  r   Ú	merge_posÚ
IndexErrorrç   Únon_merged_itemsrR   rD   r3  rM   r^   r2   rg   r  )r0   r\   rs   rh   r]   r_   rF   rk   r`   r4  r5  r6  Úmerge_valuer=  Z
item_countru   rp   ry   rz   r{   Úitem_commentÚnvcÚargr,   r,   r-   r|     s¢   ÿÿ







€ÿ€ÿ
ÿ





$
ÿz&RoundTripRepresenter.represent_mappingro   c                 C  s`  g }z|j  |¡}W n ty   |}Y nw z| ¡ }W n ty'   d }Y nw t|tƒr2t|d�}t||||d�}| jd urE|| j	| j< d}z[t
|tƒ}|jd u rW|j|_n|jd d … |_|jrs|jd rs|jd D ]}	|	 ¡  ql|j}
|
 ¡ D ]}|r�|d r�|d D ]}	|	 ¡  q†qzz	|j |j¡ W n	 ty    Y nw W n ty­   i }
Y nw |D ]i}|| }|  ||i¡}|
 |¡}|�r|d rÐd |d g|_t
|jd d dd ƒd u sßJ ‚|d d g|jd d _t
|jd d dd ƒ}|d u�r|d |d< |d |d< n|dd … |jd d _| |¡ q°|d u �r.| jd u�r+| j|_|S ||_|S )	Nra   r,  Trª   r   r`   rØ   r;  )r-  rh   rA   rî   rd   rN   re   ri   r9   r7   rc   r   r`   r.  ru   r/  rJ   r0  rD   r3  r]   r2   )r0   r\   ro   rh   r]   r_   rF   rk   r`   r4  r5  r6  rp   rq   rm   rA  rB  r,   r,   r-   rr   t  sz   ÿÿ







€ÿ€ÿ


ÿz#RoundTripRepresenter.represent_omapÚsettingc                 C  sÜ  d}t dd�}g }|j |¡}z| ¡ }W n ty    d }Y nw t||||d�}| jd ur4|| j| j< d}z[t|t	ƒ}|j
d u rF|j
|_
n|j
d d … |_
|j
rb|j
d rb|j
d D ]}	|	 ¡  q[|j}
|
 ¡ D ]}|r||d r||d D ]}	|	 ¡  quqiz	|j
 |j¡ W n	 ty�   Y nw W n tyœ   i }
Y nw |jD ]I}|  |¡}|  d ¡}|
 |¡}|rÄt|dd ƒd u s½J ‚|d d… |_
d	|_|rËd
nd	|_t|tƒrÖ|jrØd}t|tƒrà|jrâd}| ||f¡ q |}|S )NFr»   ra   r,  Trª   r`   rØ   Ú?ú-)re   r-  rh   rî   rA   rt   r9   r7   rc   r   r`   r.  ru   r/  rJ   r0  ÚodictrR   rD   r3  r^   rd   rM   )r0   rD  rh   r\   r]   r_   rF   rk   r`   r4  r5  r6  rp   rz   r{   rA  r,   r,   r-   r½   µ  sh   
ÿ





€ÿ€ÿ



z"RoundTripRepresenter.represent_setc                 C  sv   z|j }W n ty   tdd�}Y n"w |j jr0|j  d¡r,td|j jdd…  d�}n	|j }ntdd�}|  ||¡S )z!write out tag if saved on loadingr·   ra   ú!!útag:yaml.org,2002:rØ   N)r\   rA   re   ÚtrvalÚ
startswithr|   ©r0   rB   r   r\   r,   r,   r-   r¹   ê  s   
ÿ
z#RoundTripRepresenter.represent_dictc                 C  sv   z|j }W n ty   tdd�}Y n"w |j jr0|j  d¡r,td|j jdd …  d�}n	|j }ntdd�}|  ||¡S )Nr´   ra   rH  rI  rØ   )r\   rA   re   rJ  rK  rn   rL  r,   r,   r-   r¶   ú  s   
ÿ
z#RoundTripRepresenter.represent_listc                 C  sh   |j d rdnd}|j }	 | |¡ ¡ }	 |jr.t|jƒr.|d dv r.|d d… t|jƒ }|  d	|¡S )
NÚtÚTrÂ   FÚdeltaÚtziúÿÿÿz+-r¾   )Ú_yamlrÀ   ÚstripÚtzinforN   rf   )r0   rB   ÚinterrQ  r]   r,   r,   r-   rÃ   	  s   z'RoundTripRepresenter.represent_datetimec                 C  s€   z|j jdkr|j j› d|j j› �}n|j }W n ty"   d }Y nw z| ¡ }W n ty4   d }Y nw | j||j|j|d�S )NrH  rÂ   rì   )r\   Úhandlerb   rA   rî   rf   r]   r^   )r0   rB   r\   r_   r,   r,   r-   Úrepresent_tagged_scalar  s   €ÿÿz,RoundTripRepresenter.represent_tagged_scalarc                 C  s4   z|  ¡ }W n ty   d }Y nw tj| ||d�S )NrŸ   )rî   rA   r%   r    )r0   rB   r_   r,   r,   r-   Úrepresent_scalar_bool&  s   ÿz*RoundTripRepresenter.represent_scalar_boolrX   rœ   c                 C  sN   t |dƒr
| ¡ }n|j ¡ }| tjd ¡}| j|||d�}|d ur%||_|S rÄ   )	r>   rÅ   rU   rV   Úpopr   Úattribr|   r_   )r0   r\   rB   rX   rh   rÆ   r_   Úresr,   r,   r-   rÇ   -  s   


z*RoundTripRepresenter.represent_yaml_objectr   )r1   r    r2   r    r3   r    r4   r5   r…   rÉ   rC   )
rý   r    rþ   r    rÿ   r    r_   r    r4   rM   r‚   )rF   r    r8  r    r4   r    r�   r„   rƒ   )rD  r    r4   rt   rË   rÊ   )
r\   r    rB   r    rX   r    rh   rœ   r4   rt   )r)   r*   r+   r<   rH   r�   rð   Z represent_preserved_scalarstringr÷   rù   rû   rü   r  r  r  r  r  r  r+  rn   r2  rR   r|   rr   r½   r¹   r¶   rÃ   rV  rW  rÇ   r,   r,   r,   r-   r(   ì  sB    ÿ






ÿ


	

	
	Jÿ
:
	b
A
5



ÿr(   )kÚ
__future__r   Úruamel.yaml.errorÚruamel.yaml.nodesÚruamel.yaml.compatr   r   r   Úruamel.yaml.scalarstringr   r   r	   r
   r   Úruamel.yaml.commentsr   r   r   r   r   r   r   r   r   Úruamel.yaml.scalarintr   r   r   r   r   Úruamel.yaml.scalarfloatr   Úruamel.yaml.scalarboolr   Úruamel.yaml.timestampr   Úruamel.yaml.anchorr   ÚcollectionsÚdatetimeÚtypesrß   r˜   Útypingr   r   r    r!   r"   r#   Ú__all__Ú	YAMLErrorr'   r$   r%   rY   rK   r�   rN   r”   rŠ   r›   r}   r    r‹   r¢   rŒ   r³   rv   r¶   r‰   rá   r¹   Úsetr½   rº   ÚOrderedDictÚdaterÁ   rÃ   rÈ   r&   ÚcomplexrÐ   rÑ   rÔ   ÚFunctionTypeÚBuiltinFunctionTypeÚ
ModuleTyperÕ   r[   Úobjectræ   r(   rð   r÷   rù   rû   rü   r  r  r  r  r  r+  rW  rV  r,   r,   r,   r-   Ú<module>   s´   , ;pÿ\    Sÿÿÿÿÿÿÿÿ