o
    Thr3                     @   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	y-   dZY nw 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dDddZdDd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"dDd/d0Z#dDd1d2Z$ddefd3d4Z%ddefd5d6Z&dDd7d8Z'dDd9d:Z(efd;d<Z)efd=d>Z*G d?d@ d@e+Z,G dAdB dBe,dCZ-dS )E   )*z5.4.1TF    NYAMLLoadWarningc                 C   s>   | d u rt S t| tu r| D ]}|t v r| | t |< qd S d S N)_warnings_enabledtypedict)settingskey r   N/var/www/html/venv/lib/python3.10/site-packages/invoke/vendor/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   zcalling 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   L    || }z|  r| V  |  s
W |  dS W |  dS |  w )z9
    Scan a YAML stream and produce scanning tokens.
    N)check_token	get_tokendisposestreamLoaderloaderr   r   r   scan:      

r   c                 c   r   )z9
    Parse a YAML stream and produce parsing events.
    N)check_event	get_eventr   r   r   r   r   parseE   r    r#   c                 C   s&   || }z	|  W |  S |  w )zj
    Parse the first YAML document in a stream
    and produce the corresponding representation tree.
    )get_single_noder   r   r   r   r   composeP   s   r%   c                 c   r   )zb
    Parse all YAML documents in a stream
    and produce corresponding representation trees.
    N)
check_nodeget_noder   r   r   r   r   compose_all[   s   

r(   c                 C   s:   |du r
t d t}|| }z	| W |  S |  w )zd
    Parse the first YAML document in a stream
    and produce the corresponding Python object.
    Nload)r   
FullLoaderget_single_datar   r   r   r   r   r)   g   s   r)   c                 c   s`    |du rt d t}|| }z| r$| V  | sW |  dS W |  dS |  w )z\
    Parse all YAML documents in a stream
    and produce corresponding Python objects.
    Nload_all)r   r*   
check_dataget_datar   r   r   r   r   r,   v   s   

r,   c                 C   
   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      
r1   c                 C   r/   )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*   r0   r   r   r   full_load_all   r2   r3   c                 C   r/   )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)   
SafeLoaderr0   r   r   r   	safe_load   r2   r5   c                 C   r/   )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,   r4   r0   r   r   r   safe_load_all   r2   r6   c                 C   r/   )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)   UnsafeLoaderr0   r   r   r   unsafe_load   r2   r8   c                 C   r/   )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,   r7   r0   r   r   r   unsafe_load_all   r2   r9   c                 C   sh   d}|du rt  }|j}|||||||d}	z| D ]}
|	|
 qW |	  n|	  w |r2| 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<   r=   r>   rA   dumpereventr   r   r   rB      s   
rB   c                 C   s   d}|du r|du rt  }nt  }|j}|||||||||||	|
d}z|  | D ]}|| q,|  W |  n|  w |rH| 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<   r=   r>   encodingversiontagsexplicit_startexplicit_end)r?   r@   BytesIOrA   open	serializecloser   )nodesr   rD   r:   r;   r<   r=   r>   rG   rJ   rK   rH   rI   rA   rE   noder   r   r   serialize_all   s(   	


rR   c                 K      t | g|fd|i|S )zx
    Serialize a representation tree into a YAML stream.
    If stream is None, return the produced string instead.
    rD   )rR   )rQ   r   rD   kwdsr   r   r   rN         rN   c                 C   s   d}|du r|
du rt  }nt  }|j}|||||||||	|
|||||d}z|  | D ]}|| q/|  W |  n|  w |rK| 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<   r=   r>   rG   rH   rI   rJ   rK   	sort_keys)r?   r@   rL   rA   rM   	representrO   r   )	documentsr   rD   rV   rW   r:   r;   r<   r=   r>   rG   rJ   rK   rH   rI   rX   rA   rE   datar   r   r   dump_all   s,   


r\   c                 K   rS   )zr
    Serialize a Python object into a YAML stream.
    If stream is None, return the produced string instead.
    rD   )r\   )r[   r   rD   rT   r   r   r   dump  rU   r]   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.
    rD   r\   
SafeDumper)rZ   r   rT   r   r   r   safe_dump_all$  s   r`   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.
    rD   r^   )r[   r   rT   r   r   r   	safe_dump,  s   ra   c                 C   Z   |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*   r7   )tagregexpfirstr   rD   r   r   r   rc   4  s   rc   c                 C   rb   )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*   r7   )rd   pathkindr   rD   r   r   r   rg   D  s   rg   c                 C   F   |du rt j| | t j| | t j| | dS || | 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*   r7   )rd   constructorr   r   r   r   rk   S  s
   rk   c                 C   rj   )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*   r7   )
tag_prefixmulti_constructorr   r   r   r   rm   `  s
   rm   c                 C      | | | 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_typerepresenterrD   r   r   r   rq   n     rq   c                 C   rp   )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)rr   multi_representerrD   r   r   r   ru   w  rt   ru   c                       s    e Zd ZdZ fddZ  ZS )YAMLObjectMetaclassz'
    The metaclass for YAMLObject.
    c                    s   t t| ||| d|v r<|d d ur>t| jtr)| jD ]
}|| j| j qn	| j| j| j | j	
| | j d S d S d S )Nyaml_tag)superrw   __init__
isinstanceyaml_loaderlistrk   rx   	from_yamlyaml_dumperrq   to_yaml)clsnamebasesrT   r   	__class__r   r   rz     s   
zYAMLObjectMetaclass.__init__)r   r   r   __doc__rz   __classcell__r   r   r   r   rw     s    rw   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.
        )construct_yaml_object)r   r   rQ   r   r   r   r~     s   zYAMLObject.from_yamlc                 C   s   |j | j|| | jdS )zC
        Convert a Python object to a representation node.
        )
flow_style)represent_yaml_objectrx   yaml_flow_style)r   rE   r[   r   r   r   r     s   zYAMLObject.to_yaml)r   r   r   r   	__slots__r   r*   r7   r|   rD   r   rx   r   classmethodr~   r   r   r   r   r   r     s    

r   )	metaclassr   ).errortokensrC   rP   r   rE   __version__cyaml__with_libyaml__ImportErrorr?   r   r   RuntimeWarningr   r   r   r   r#   r%   r(   r)   r,   r1   r3   r5   r6   r8   r9   rD   rB   rR   rN   r\   r]   r`   ra   rc   rg   rk   rm   rq   ru   r   rw   r   r   r   r   r   <module>   s|   












!




		