a
    »ÏOcr3  ã                   @   s  d dl T d dlT d dlT d dlT d dlT d dlT dZzd dlT dZW n e	yZ   dZY n0 ddl
Z
ddiZdDdd	„ZG d
d„ deƒZdd„ Zefdd„Zefdd„Zefdd„Zefdd„ZdEdd„ZdFdd„Zdd„ Zdd„ Zdd„ Zdd „ Zd!d"„ Zd#d$„ Zdedddddfd%d&„Zdeddddddddddfd'd(„Zdefd)d*„Z dedddddddddddddfd+d,„Z!defd-d.„Z"dGd/d0„Z#dHd1d2„Z$ddefd3d4„Z%ddefd5d6„Z&dId7d8„Z'dJd9d:„Z(efd;d<„Z)efd=d>„Z*G d?d@„ d@e+ƒZ,G dAdB„ dBe,dC�Z-dS )Ké   )Ú*z5.4.1TFé    NÚYAMLLoadWarningc                 C   s:   | d u rt S t| ƒtu r6| D ]}|t v r| | t |< qd S )N)Ú_warnings_enabledÚtypeÚdict)ÚsettingsÚkey© r
   úD/var/www/html/gsl.tools/lib/python3.9/site-packages/yaml/__init__.pyÚwarnings   s    r   c                   @   s   e Zd ZdS )r   N)Ú__name__Ú
__module__Ú__qualname__r
   r
   r
   r   r   (   s   c                 C   s4   t d du rd S dd l}d|  }|j|tdd� d S )Nr   Fr   zŽcalling yaml.%s() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.é   )Ú
stacklevel)r   r   Úwarnr   )Úmethodr   Úmessager
   r
   r   Úload_warning+   s    ür   c                 c   s8   || ƒ}z |  ¡ r| ¡ V  q
W | ¡  n
| ¡  0 dS )z9
    Scan a YAML stream and produce scanning tokens.
    N)Zcheck_tokenÚ	get_tokenÚdispose©ÚstreamÚLoaderÚloaderr
   r
   r   Úscan:   s
    r   c                 c   s8   || ƒ}z |  ¡ r| ¡ V  q
W | ¡  n
| ¡  0 dS )z9
    Parse a YAML stream and produce parsing events.
    N)Zcheck_eventZ	get_eventr   r   r
   r
   r   ÚparseE   s
    r   c                 C   s*   || ƒ}z|  ¡ W | ¡  S | ¡  0 dS )zj
    Parse the first YAML document in a stream
    and produce the corresponding representation tree.
    N)Zget_single_noder   r   r
   r
   r   ÚcomposeP   s    þr   c                 c   s8   || ƒ}z |  ¡ r| ¡ V  q
W | ¡  n
| ¡  0 dS )zb
    Parse all YAML documents in a stream
    and produce corresponding representation trees.
    N)Z
check_nodeZget_noder   r   r
   r
   r   Úcompose_all[   s
    r   c                 C   s>   |du rt dƒ t}|| ƒ}z| ¡ W | ¡  S | ¡  0 dS )zd
    Parse the first YAML document in a stream
    and produce the corresponding Python object.
    NÚload)r   Ú
FullLoaderZget_single_datar   r   r
   r
   r   r    g   s    þr    c                 c   sL   |du rt dƒ t}|| ƒ}z | ¡ r2| ¡ V  qW | ¡  n
| ¡  0 dS )z\
    Parse all YAML documents in a stream
    and produce corresponding Python objects.
    NÚload_all)r   r!   Z
check_dataÚget_datar   r   r
   r
   r   r"   v   s    r"   c                 C   s
   t | tƒS )z²
    Parse the first YAML document in a stream
    and produce the corresponding Python object.

    Resolve all tags except those known to be
    unsafe on untrusted input.
    )r    r!   ©r   r
   r
   r   Ú	full_load†   s    r%   c                 C   s
   t | tƒS )zª
    Parse all YAML documents in a stream
    and produce corresponding Python objects.

    Resolve all tags except those known to be
    unsafe on untrusted input.
    )r"   r!   r$   r
   r
   r   Úfull_load_all�   s    r&   c                 C   s
   t | tƒS )z¹
    Parse the first YAML document in a stream
    and produce the corresponding Python object.

    Resolve only basic YAML tags. This is known
    to be safe for untrusted input.
    )r    Ú
SafeLoaderr$   r
   r
   r   Ú	safe_loadš   s    r(   c                 C   s
   t | tƒS )z±
    Parse all YAML documents in a stream
    and produce corresponding Python objects.

    Resolve only basic YAML tags. This is known
    to be safe for untrusted input.
    )r"   r'   r$   r
   r
   r   Úsafe_load_all¤   s    r)   c                 C   s
   t | tƒS )z±
    Parse the first YAML document in a stream
    and produce the corresponding Python object.

    Resolve all tags, even those known to be
    unsafe on untrusted input.
    )r    ÚUnsafeLoaderr$   r
   r
   r   Úunsafe_load®   s    r+   c                 C   s
   t | tƒS )z©
    Parse all YAML documents in a stream
    and produce corresponding Python objects.

    Resolve all tags, even those known to be
    unsafe on untrusted input.
    )r"   r*   r$   r
   r
   r   Úunsafe_load_all¸   s    r,   c                 C   sh   d}|du rt  ¡ }|j}|||||||d�}	z | D ]}
|	 |
¡ q4W |	 ¡  n
|	 ¡  0 |rd|ƒ S dS )zl
    Emit YAML parsing events into a stream.
    If stream is None, return the produced string instead.
    N)Ú	canonicalÚindentÚwidthÚallow_unicodeÚ
line_break)ÚioÚStringIOÚgetvalueÚemitr   )Úeventsr   ÚDumperr-   r.   r/   r0   r1   r4   ÚdumperÚeventr
   r
   r   r5   Â   s    
ÿr5   c                 C   s”   d}|du r,|du rt  ¡ }nt  ¡ }|j}|||||||||||	|
d�}z0| ¡  | D ]}| |¡ qX| ¡  W | ¡  n
| ¡  0 |r�|ƒ S dS )z…
    Serialize a sequence of representation trees into a YAML stream.
    If stream is None, return the produced string instead.
    N)
r-   r.   r/   r0   r1   ÚencodingÚversionÚtagsÚexplicit_startÚexplicit_end)r2   r3   ÚBytesIOr4   ÚopenÚ	serializeÚcloser   )Únodesr   r7   r-   r.   r/   r0   r1   r:   r=   r>   r;   r<   r4   r8   Únoder
   r
   r   Úserialize_all×   s&    	

ý
rE   c                 K   s   t | g|fd|i|¤ŽS )zx
    Serialize a representation tree into a YAML stream.
    If stream is None, return the produced string instead.
    r7   )rE   )rD   r   r7   Úkwdsr
   r
   r   rA   õ   s    rA   c                 C   sš   d}|du r,|
du rt  ¡ }nt  ¡ }|j}|||||||||	|
|||||d�}z0| ¡  | D ]}| |¡ q^| ¡  W | ¡  n
| ¡  0 |r–|ƒ S dS )z
    Serialize a sequence of Python objects into a YAML stream.
    If stream is None, return the produced string instead.
    N)Údefault_styleÚdefault_flow_styler-   r.   r/   r0   r1   r:   r;   r<   r=   r>   Ú	sort_keys)r2   r3   r?   r4   r@   Z	representrB   r   )Ú	documentsr   r7   rG   rH   r-   r.   r/   r0   r1   r:   r=   r>   r;   r<   rI   r4   r8   Údatar
   r
   r   Údump_allü   s*    

û
rL   c                 K   s   t | g|fd|i|¤ŽS )zr
    Serialize a Python object into a YAML stream.
    If stream is None, return the produced string instead.
    r7   )rL   )rK   r   r7   rF   r
   r
   r   Údump  s    rM   c                 K   s   t | |fdti|¤ŽS )z¡
    Serialize a sequence of Python objects into a YAML stream.
    Produce only basic YAML tags.
    If stream is None, return the produced string instead.
    r7   ©rL   Z
SafeDumper)rJ   r   rF   r
   r
   r   Úsafe_dump_all$  s    rO   c                 K   s   t | g|fdti|¤ŽS )z”
    Serialize a Python object into a YAML stream.
    Produce only basic YAML tags.
    If stream is None, return the produced string instead.
    r7   rN   )rK   r   rF   r
   r
   r   Ú	safe_dump,  s    rP   c                 C   sZ   |du r:t j | ||¡ t j | ||¡ t j | ||¡ n| | ||¡ | | ||¡ dS )zÙ
    Add an implicit scalar detector.
    If an implicit scalar value matches the given regexp,
    the corresponding tag is assigned to the scalar.
    first is a sequence of possible initial characters or None.
    N)r   r   Úadd_implicit_resolverr!   r*   )ÚtagÚregexpÚfirstr   r7   r
   r
   r   rQ   4  s    rQ   c                 C   sZ   |du r:t j | ||¡ t j | ||¡ t j | ||¡ n| | ||¡ | | ||¡ dS )zÁ
    Add a path based resolver for the given tag.
    A path is a list of keys that forms a path
    to a node in the representation tree.
    Keys can be string values, integers, or None.
    N)r   r   Úadd_path_resolverr!   r*   )rR   ÚpathÚkindr   r7   r
   r
   r   rU   D  s    rU   c                 C   sD   |du r4t j | |¡ t j | |¡ t j | |¡ n| | |¡ dS )z¯
    Add a constructor for the given tag.
    Constructor is a function that accepts a Loader instance
    and a node object and produces the corresponding Python object.
    N)r   r   Úadd_constructorr!   r*   )rR   Úconstructorr   r
   r
   r   rX   S  s
    rX   c                 C   sD   |du r4t j | |¡ t j | |¡ t j | |¡ n| | |¡ dS )a  
    Add a multi-constructor for the given tag prefix.
    Multi-constructor is called for a node if its tag starts with tag_prefix.
    Multi-constructor accepts a Loader instance, a tag suffix,
    and a node object and produces the corresponding Python object.
    N)r   r   Úadd_multi_constructorr!   r*   )Z
tag_prefixZmulti_constructorr   r
   r
   r   rZ   `  s
    rZ   c                 C   s   |  | |¡ dS )zÍ
    Add a representer for the given type.
    Representer is a function accepting a Dumper instance
    and an instance of the given data type
    and producing the corresponding representation node.
    N)Úadd_representer)Ú	data_typeZrepresenterr7   r
   r
   r   r[   n  s    r[   c                 C   s   |  | |¡ dS )zÞ
    Add a representer for the given type.
    Multi-representer is a function accepting a Dumper instance
    and an instance of the given data type or subtype
    and producing the corresponding representation node.
    N)Úadd_multi_representer)r\   Zmulti_representerr7   r
   r
   r   r]   w  s    r]   c                       s    e Zd ZdZ‡ fdd„Z‡  ZS )ÚYAMLObjectMetaclassz'
    The metaclass for YAMLObject.
    c                    sx   t t| ƒ |||¡ d|v rt|d d urtt| jtƒrR| jD ]}| | j| j¡ q:n| j | j| j¡ | j	 
| | j¡ d S )NÚyaml_tag)Úsuperr^   Ú__init__Ú
isinstanceÚyaml_loaderÚlistrX   r_   Ú	from_yamlÚyaml_dumperr[   Úto_yaml)ÚclsÚnameÚbasesrF   r   ©Ú	__class__r
   r   ra   „  s    
zYAMLObjectMetaclass.__init__)r   r   r   Ú__doc__ra   Ú__classcell__r
   r
   rk   r   r^   €  s   r^   c                   @   sB   e Zd ZdZdZeeegZe	Z
dZdZedd„ ƒZedd„ ƒZdS )Ú
YAMLObjectza
    An object that can dump itself to a YAML stream
    and load itself from a YAML stream.
    r
   Nc                 C   s   |  || ¡S )zC
        Convert a representation node to a Python object.
        )Zconstruct_yaml_object)rh   r   rD   r
   r
   r   re   �  s    zYAMLObject.from_yamlc                 C   s   |j | j|| | jd�S )zC
        Convert a Python object to a representation node.
        )Z
flow_style)Zrepresent_yaml_objectr_   Úyaml_flow_style)rh   r8   rK   r
   r
   r   rg   ¤  s    ÿzYAMLObject.to_yaml)r   r   r   rm   Ú	__slots__r   r!   r*   rc   r7   rf   r_   rp   Úclassmethodre   rg   r
   r
   r
   r   ro   �  s   

ro   )Ú	metaclass)N)N)N)N)N)N)N).ÚerrorÚtokensr6   rC   r   r8   Ú__version__ZcyamlZ__with_libyaml__ÚImportErrorr2   r   r   ÚRuntimeWarningr   r   r   r   r   r   r   r    r"   r%   r&   r(   r)   r+   r,   r7   r5   rE   rA   rL   rM   rO   rP   rQ   rU   rX   rZ   r[   r]   r   r^   ro   r
   r
   r
   r   Ú<module>   sx   
ÿ









þ
ü
û
!

ÿ


		