o
    h                     @   s  d dl T d dlT d dlmZ d dlmZ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Z1G dd de2Z3G dd dZ4G dd de4Z5e56e7de5j8 e56e9e5j: e56e;e5j< e56e=e5j> e56e?e5j@ e56eAe5jB e56eCe5jD e56eEe5jD e56eFe5jG e56eHe5jI e56ee5jJ e&jKdkrd dlLZLe56eLjMe5jJ e56e%jNe5jO e56e%j%e5jP e56de5jQ G dd de5ZReR6eSeRjT eR6eEeRjU eR6e7eRjV eR6e'jWeRjV eR6e'jXeRjV eR6e'jYeRjZ eR[e\eRj] eR[e7eRjV G dd de5Z^e^6e7de^j8 e^6ee^j_ e^6e	e^j` e^6e
e^ja e^6ee^jb e^6ee^jc e^6ee^jd e^6ee^je e^6ee^jf e^6ee^jg e^6ee^jh e^6ee^ji e^6e e^jj e^6ee^jD e^6ee^jG e^6ee^jJ e&jKdkrd dlLZLe^6eLjMe^jJ e^6ee^jI e^6ee^jk e^6e"e^jP dS )    )*)ordereddict)_F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,   _/var/www/html/magazine_api/magazine_env/lib/python3.10/site-packages/ruamel/yaml/representer.pyr'   /   s    r'   c                   @   s   e Zd Zi Zi ZdddZedd Zdd Zdd	 Z	d
d Z
edd Zedd ZdddZdddZdddZdddZdd ZdS )r$   Nc                 C   s@   || _ | j d ur| | j _|| _|| _i | _g | _d | _d| _d S )NT)dumperZ_representerdefault_styledefault_flow_stylerepresented_objectsobject_keeper	alias_key sort_base_mapping_type_on_outputselfr/   r0   r.   r,   r,   r-   __init__8   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)hasattrr.   
serializerZ_serializerAttributeError)r6   r,   r,   r-   r:   D   s   

zBaseRepresenter.serializerc                 C   s,   |  |}| j| i | _g | _d | _d S N)represent_datar:   	serializer1   r2   r3   )r6   datanoder,   r,   r-   	representN   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_aliasesr3   idr1   r2   appendtype__mro__yaml_representersyaml_multi_representers
ScalarNodestr)r6   r?   r@   
data_types	data_typer,   r,   r-   r=   V   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
        )r=   r6   r?   r,   r,   r-   represent_keyx   s   
zBaseRepresenter.represent_keyc                 C   $   d| j vr| j | _|| j|< d S )NrG   )__dict__rG   copyclsrL   Zrepresenterr,   r,   r-   add_representer      
zBaseRepresenter.add_representerc                 C   rO   )NrH   )rP   rH   rQ   rR   r,   r,   r-   add_multi_representer   rU   z%BaseRepresenter.add_multi_representerc                 C   sh   |d u r| j }d }|r|d dv rt|dd }|rd |gg}t|||||d}| jd ur2|| j| j< |S )Nr   z|>comment)stylerW   anchor)r/   getattrrI   r3   r1   )r6   tagvaluerX   rY   rW   r@   r,   r,   r-   represent_scalar   s   

z BaseRepresenter.represent_scalarc           	      C   s   g }t |||d}| jd ur|| j| j< d}|D ]}| |}t|tr'|jr)d}|| q|d u rA| jd ur>| j|_	|S ||_	|S )N
flow_styleTF)
SequenceNoder3   r1   r=   
isinstancerI   rX   rD   r0   r_   )	r6   r[   sequencer_   r\   r@   
best_styleitem	node_itemr,   r,   r-   represent_sequence   s    


z"BaseRepresenter.represent_sequencec           
      C   s~   g }t |||d}| jd ur|| j| j< d}|D ]}|| }| ||i}	||	 q|d u r=| jd ur:| j|_|S ||_|S )Nr^   T)r`   r3   r1   r=   rD   r0   r_   )
r6   r[   omapr_   r\   r@   rc   item_keyitem_valre   r,   r,   r-   represent_omap   s   

zBaseRepresenter.represent_omapc                 C   s   g }t |||d}| jd ur|| j| j< d}t|dr4t| }| jr4zt|}W n	 ty3   Y nw |D ])\}}| 	|}	| 
|}
t|	trL|	jrNd}t|
trV|
jrXd}||	|
f q6|d u rr| jd uro| j|_|S ||_|S )Nr^   TitemsF)MappingNoder3   r1   r9   listrk   r4   sorted	TypeErrorrN   r=   ra   rI   rX   rD   r0   r_   )r6   r[   mappingr_   r\   r@   rc   rh   
item_valuenode_key
node_valuer,   r,   r-   represent_mapping   s6   




z!BaseRepresenter.represent_mappingc                 C   s   dS NFr,   rM   r,   r,   r-   rB      s   zBaseRepresenter.ignore_aliasesNNN)NNr<   )r)   r*   r+   rG   rH   r7   propertyr:   rA   r=   rN   classmethodrT   rV   r]   rf   rj   rt   rB   r,   r,   r,   r-   r$   3   s$    

	"






r$   c                   @   s   e Zd Zdd Zdd Zdd Zdd Zd!d
dZdd ZdZ	e
e	e
e	e	 kr7e	e	9 Z	e
e	e
e	e	 ks)dd Zdd Zdd Zdd Zdd Zdd Zdd Zd!ddZdd  Zd	S )"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)ra   tuplebytesrJ   boolintfloatrM   r,   r,   r-   rB      s
   zSafeRepresenter.ignore_aliasesc                 C   s   |  ddS )Ntag:yaml.org,2002:nullnullr]   rM   r,   r,   r-   represent_none      zSafeRepresenter.represent_nonec                 C      |  d|S )Ntag:yaml.org,2002:strr   rM   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|)rX   )r9   base64r   decodeencodestringr]   rM   r,   r,   r-   represent_binary   s   
z SafeRepresenter.represent_binaryNc                 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rY   )r.   Zboolean_representationr{   r;   r]   )r6   r?   rY   r\   r,   r,   r-   represent_bool  s   zSafeRepresenter.represent_boolc                 C   s   |  dt|S )Ntag:yaml.org,2002:int)r]   rJ   rM   r,   r,   r-   represent_int     zSafeRepresenter.represent_intgu <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-.infZuse_version)   r   .ez.0er   tag:yaml.org,2002:float)	inf_valuereprlowerrZ   r:   replacer]   r6   r?   r\   r,   r,   r-   represent_float  s   
zSafeRepresenter.represent_floatc                 C   r   )Ntag:yaml.org,2002:seqrf   rM   r,   r,   r-   represent_list.  s   	zSafeRepresenter.represent_listc                 C   r   )Ntag:yaml.org,2002:maprt   rM   r,   r,   r-   represent_dict?  r   zSafeRepresenter.represent_dictc                 C   r   )Nztag:yaml.org,2002:omap)rj   rM   r,   r,   r-   represent_ordereddictC  r   z%SafeRepresenter.represent_ordereddictc                 C   s"   i }|D ]}d ||< q|  d|S )Ntag:yaml.org,2002:setr   )r6   r?   r\   keyr,   r,   r-   represent_setG  s   
zSafeRepresenter.represent_setc                 C   s   |  }| d|S )Ntag:yaml.org,2002:timestamp	isoformatr]   r   r,   r,   r-   represent_dateN  s   zSafeRepresenter.represent_datec                 C   s   | d}| d|S )N r   r   r   r,   r,   r-   represent_datetimeS  s   
z"SafeRepresenter.represent_datetimec                 C   s.   t |dr
| }n|j }| j|||dS N__getstate__r^   )r9   r   rP   rQ   rt   )r6   r[   r?   rS   r_   stater,   r,   r-   represent_yaml_objectX  s   


z%SafeRepresenter.represent_yaml_objectc                 C   s   t td|d)Nz$cannot represent an object: {data!s}r?   )r'   r   rM   r,   r,   r-   represent_undefined`  r   z#SafeRepresenter.represent_undefinedr<   )r)   r*   r+   rB   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r,   r,   r,   r-   r%      s(    
	
r%   )      c                   @   s4   e Zd Zdd Zdd Zdd Zdd Zd	d
 ZdS )r&   c                 C   sl   |j dkrt|j}n%|jdkrtd|j d}n|j dkr'td|j|j d}n	td|j|j d}| d|S )	Nr   z{data_imag!r}j)	data_imagr   z{data_real!r}+{data_imag!r}j)Z	data_realr   z{data_real!r}{data_imag!r}jz tag:yaml.org,2002:python/complex)imagr   realr   r]   rM   r,   r,   r-   represent_complex  s   


zRepresenter.represent_complexc                 C   r   )Nztag:yaml.org,2002:python/tupler   rM   r,   r,   r-   represent_tuple  r   zRepresenter.represent_tuplec                 C   sL   zt d|j|jd}W n ty   t d|j|jd}Y nw | d| dS )Nz{modname!s}.{qualname!s})modnamequalnamez{modname!s}.{name!s})r   nameztag:yaml.org,2002:python/name: )r   r*   r+   r;   r)   r]   )r6   r?   r   r,   r,   r-   represent_name  s   

zRepresenter.represent_namec                 C   s   |  d|j dS )Nz tag:yaml.org,2002:python/module:r   )r]   r)   rM   r,   r,   r-   represent_module  s   zRepresenter.represent_modulec                 C   s  t |}|tjv rtj| |}nt|dr|d}nt|dr&| }nttd|dt|d gd  d d }|\}}}}}t|}|d u rLi }|d urTt|}|d ur\t	|}|j
dkrp|d }|d	d  }d
}	d}
nd}	d}
ztd|j|jd}W n ty   td|j|j
d}Y nw |s|s|st|t	r|
r| d| |S |s|st|t	r|s| |	| |S i }|r||d< |st|t	s||d< |r||d< |r||d< | |	| |S )N__reduce_ex__r   
__reduce__z!cannot represent object: {data!r}r      
__newobj__r   r   z$tag:yaml.org,2002:python/object/new:Tz&tag:yaml.org,2002:python/object/apply:Fz{fun!s}.{qualname!s})funr   z{fun!s}.{name!s})r   r   z tag:yaml.org,2002:python/object:argsr   	listitems	dictitems)rE   copyregdispatch_tabler9   r   r   r'   r   rm   dictr)   r*   r+   r;   ra   rt   rf   )r6   r?   rS   reducefunctionr   r   r   r   r[   ZnewobjZfunction_namer\   r,   r,   r-   represent_object  sb   








zRepresenter.represent_objectN)r)   r*   r+   r   r   r   r   r   r,   r,   r,   r-   r&     s    r&   c                   @   s   e Zd Zd8ddZdd Zdd Zdd	 ZeZd
d Zdd Z	dd Z
dd Zd9ddZdd Zdd Zdd Zdd Zdd Zdd Zd9d d!Zd"d# Zd$d% Zd9d&d'Zd9d(d)Zd*d+ Zd,d- Zd.d/ Zd0d1 Zd2d3 Zd4d5 Zd9d6d7ZdS ):r(   Nc                 C   s,   t |ds|d u rd}tj| |||d d S )Nr8   F)r/   r0   r.   )r9   r%   r7   r5   r,   r,   r-   r7     s   
zRoundTripRepresenter.__init__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 ru   )rY   r\   r;   r%   rB   rM   r,   r,   r-   rB     s   z#RoundTripRepresenter.ignore_aliasesc                 C   s.   t | jdkr| jjs| ddS | ddS )Nr   r~   r   r   )lenr1   r:   Zuse_explicit_startr]   rM   r,   r,   r-   r     s   z#RoundTripRepresenter.represent_nonec                 C   *   d }d}|j dd}d}| j||||dS )Nr   Tanyr   rX   rY   yaml_anchorr]   r6   r?   r[   rX   rY   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   reversedrZ   isspacer   r]   )r6   r?   r[   rX   rY   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_scalarstring9  r   z9RoundTripRepresenter.represent_single_quoted_scalarstringc                 C   r   )N"Tr   r   r   r   r   r,   r,   r-   $represent_double_quoted_scalarstringA  r   z9RoundTripRepresenter.represent_double_quoted_scalarstringc                 C   r   )Nr   Tr   r   r   r   r   r,   r,   r-   represent_plain_scalarstringI  r   z1RoundTripRepresenter.represent_plain_scalarstringc                 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   )r]   rm   r   insertjoin)r6   prefixsZ
underscorerY   slposr,   r,   r-   insert_underscoreQ  s   
z&RoundTripRepresenter.insert_underscorec                 C   D   |j d urd||j }nt|d}|jdd}| jd||j|dS )Nz{:0{}d}dTr   r   r   _widthformatr   r   Z_underscorer6   r?   r   rY   r,   r,   r-   represent_scalar_intb  s
   

z)RoundTripRepresenter.represent_scalar_intc                 C   r   )Nz{:0{}b}bTr   0br   r   r   r,   r,   r-   represent_binary_intk  
   

z)RoundTripRepresenter.represent_binary_intc                 C   r   )Nz{:0{}o}oTr   Z0or   r   r   r,   r,   r-   represent_octal_intu  r   z(RoundTripRepresenter.represent_octal_intc                 C   r   )Nz{:0{}x}xTr   0xr   r   r   r,   r,   r-   represent_hex_int  r   z&RoundTripRepresenter.represent_hex_intc                 C   r   )Nz{:0{}X}XTr   r   r   r   r   r,   r,   r-   represent_hex_caps_int  r   z+RoundTripRepresenter.represent_hex_caps_intc                 C   s  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 rU|jdkrU|j|jd krUd|jrK|jndtt	|}n|jdu r|j}|jrc|jnd}d|t||jt
| |j| d }|dks|dkr|dkr|dd}t
||jk r|d7 }t
||jk snAd||j|j|jrdnd d\}}|jdkr|jn|jd }|dk r|d7 }|d| }t	|}	|d\}
}t
|
t
| |j|jdkrd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rdnd}|jdk rq|dkr/|	t
|8 }	nd}t
|
t
| |jr>dnd |jk ra|d7 }|	d8 }	t
|
t
| |jrZdnd |jk sE|
| |j d|	||j }no|jdkr|	t
|8 }	|
| d |j d|	||j }nQ|jdkrd|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u rt| }| jd	||d
S )z this is way more complicated NTr   r   r   r   r   r   r   r   r   r   z{}{:d}.r   z{}{:0{}.{}f}z0.r   0z	{:{}.{}e}r   +z	{:{}0{}d})r   r   r]   _expZ_precr   r   Z_m_signabsr|   r   r   splitZ_e_signZ_e_widthZ_m_lead0r   r   )r6   r?   r\   rY   precmsmeswr   m1m2Zesgnr,   r,   r-   represent_scalar_float  s   
$$
 **
(( $
"
z+RoundTripRepresenter.represent_scalar_floatc                 C   s  g }z|j |}W n ty   |}Y nw z| }W n ty'   d }Y nw t||||d}| jd ur;|| j| j< d}zbt|t}|j	|_	|j	r[|j	d r[|j	d D ]}	|	
  qT|j}
|
 D ]}|ru|d ru|d D ]}	|	
  qnqb|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rd}|| q|d u rt|dkr| jd ur| j|_|S ||_|S )Nr_   rY   Tr   Fr   )far_   r;   r   r`   r3   r1   rZ   r   rW   resetrk   valuesrD   end	enumerater=   merge_commentsgetra   rI   rX   r   r0   )r6   r[   rb   r_   r\   rY   r@   rc   rW   ctitem_commentsvidxrd   re   r,   r,   r-   rf     sh   






z'RoundTripRepresenter.represent_sequencec                 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 )NrW   )r9   rZ   r  r   rW   )r6   r@   commentsr  valncr,   r,   r-   r    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   Tr^   r   )ra   r   r3   rf   r   rt   r%   rN   rM   r,   r,   r-   rN   %  s   

z"RoundTripRepresenter.represent_keyc                 C   s  g }z|j |}W n ty   |}Y nw z| }W n ty'   d }Y nw t||||d}| jd ur;|| j| j< d}zbt|t}|j	d u rM|j	|_	n|j	d d  |_	|j	ri|j	d ri|j	d D ]}	|	
  qb|j}
| jjd u r|
 D ]}|r|d r|d D ]}	|	
  qqvz	|j	|j W n
 ty   Y nw 	 W n ty   i }
Y nw dd t|tg D }zt|tdggd d }W n ty   d}Y nw d}t|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sPt|r[| jd ur[| j|_n||_t|rt|dkrr| |d }n| |}d|_||tdd|f |S )Nr  Tr   c                 S   s   g | ]}|d  qS )r   r,   ).0r
  r,   r,   r-   
<listcomp>X  s    z:RoundTripRepresenter.represent_mapping.<locals>.<listcomp>r   r   rW      Fztag:yaml.org,2002:mergez<<)r  r_   r;   r   rl   r3   r1   rZ   r   rW   r  rk   r.   Zcomment_handlingr  rD   r  r   
IndexErrorr{   Znon_merged_itemsrN   r=   r  ra   rI   rX   r0   r   r   )r6   r[   rp   r_   r\   rY   r@   rc   rW   r  r  r  Z
merge_listZ	merge_pos
item_countrk   rh   rq   rr   rs   item_commentnvcargr,   r,   r-   rt   /  s   











 


z&RoundTripRepresenter.represent_mappingc                 C   sJ  g }z|j |}W n ty   |}Y nw z| }W n ty'   d }Y nw t||||d}| jd ur;|| j| j< d}z[t|t}|j	d u rM|j	|_	n|j	d d  |_	|j	ri|j	d ri|j	d D ]}	|	
  qb|j}
|
 D ]}|r|d r|d D ]}	|	
  q|qpz	|j	|j W n	 ty   Y nw W n ty   i }
Y nw |D ]h}|| }| ||i}|
|}|r	|d rd |d g|_	t|jd d dd d u sJ |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 )Nr  Tr   r   rW   r   r!  )r  r_   r;   r   r`   r3   r1   rZ   r   rW   r  rk   r  rD   r  r=   r  r\   r0   )r6   r[   rg   r_   r\   rY   r@   rc   rW   r  r  r  rh   ri   re   r$  r%  r,   r,   r-   rj     sv   







z#RoundTripRepresenter.represent_omapc                 C   s  d}d}g }|j |}z| }W n ty   d }Y nw t||||d}| jd ur1|| j| j< d}z[t|t}|j	d u rC|j	|_	n|j	d d  |_	|j	r_|j	d r_|j	d D ]}	|	
  qX|j}
|
 D ]}|ry|d ry|d D ]}	|	
  qrqfz	|j	|j W n	 ty   Y nw W n ty   i }
Y nw |jD ]E}| |}| d }|
|}|rt|dd d u sJ |d d |_	d |_|_t|tr|jrd}t|tr|jrd}|||f q|}|S )	NFr   r  Tr   rW   r   ?)r  r_   r   r;   rl   r3   r1   rZ   r   rW   r  rk   r  rD   r  ZodictrN   r=   r  rX   ra   rI   )r6   Zsettingr_   r[   r\   rY   r@   rc   rW   r  r  r  rh   rr   rs   r$  r,   r,   r-   r     sf   









z"RoundTripRepresenter.represent_setc                 C   sZ   z|j j}W n ty   d}Y nw |r%|dr"d|dd  }n|}nd}| ||S )z!write out tag if saved on loadingN!!tag:yaml.org,2002:r   r   )r[   r\   r;   
startswithrt   r6   r?   tr[   r,   r,   r-   r     s   
z#RoundTripRepresenter.represent_dictc                 C   sZ   z|j j}W n ty   d }Y nw |r%|dr"d|dd   }n|}nd}| ||S )Nr(  r)  r   r   )r[   r\   r;   r*  rf   r+  r,   r,   r-   r     s   
z#RoundTripRepresenter.represent_listc                 C   sb   |j d rdnd}|j }|d r||d 7 }||}n||}|d r+||d 7 }| d|S )Nr,  Tr   deltatzr   )_yamlr   r]   )r6   r?   interr0  r\   r,   r,   r-   r     s   
z'RoundTripRepresenter.represent_datetimec                 C   s^   z|j j}W n ty   d }Y nw z| }W n ty#   d }Y nw | j||j|j|dS )Nr   )r[   r\   r;   r   r]   rX   )r6   r?   r[   rY   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   r;   r%   r   )r6   r?   rY   r,   r,   r-   represent_scalar_bool4  s   z*RoundTripRepresenter.represent_scalar_boolc                 C   sN   t |dr
| }n|j }|tjd }| j|||d}|d ur%||_|S r   )	r9   r   rP   rQ   popr   Zattribrt   rY   )r6   r[   r?   rS   r_   r   rY   resr,   r,   r-   r   <  s   


z*RoundTripRepresenter.represent_yaml_objectrv   r<   )r)   r*   r+   r7   rB   r   r   Z represent_preserved_scalarstringr   r   r   r   r   r   r   r   r   r  r  rf   r  rN   rt   rj   r   r   r   r   r2  r3  r   r,   r,   r,   r-   r(     s:    
	
	




K7


X@5r(   )lZruamel.yaml.errorZruamel.yaml.nodesZruamel.yaml.compatr   r   r   r   Zruamel.yaml.scalarstringr   r   r	   r
   r   Zruamel.yaml.commentsr   r   r   r   r   r   r   r   r   Zruamel.yaml.scalarintr   r   r   r   r   Zruamel.yaml.scalarfloatr   Zruamel.yaml.scalarboolr   Zruamel.yaml.timestampr   Zruamel.yaml.anchorr   datetimesystypesr   r   typingr   r   r    r!   r"   r#   __all__Z	YAMLErrorr'   r$   r%   rT   rE   r   rJ   r   rz   r   r{   r   r|   r   r}   r   rm   r   ry   r   r   setr   r   version_infocollectionsOrderedDictdater   r   r   r&   complexr   r   r   FunctionTypeBuiltinFunctionType
ModuleTyper   rV   objectr   r(   r   r   r   r   r   r   r   r   r   r  r  r3  r2  r,   r,   r,   r-   <module>   s   , 6}
g    L