U
    9%e0                     @   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	k
r\   dZY nX ddl
Z
d@ddZefd	d
ZefddZefddZefddZdd Zd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dAd+d,ZdBd-d.Z ddefd/d0Z!ddefd1d2Z"dCd3d4Z#dDd5d6Z$efd7d8Z%efd9d:Z&G d;d< d<e'Z(G d=d> d>e(d?Z)dS )E   )*z6.0.1TF    Nc                 C   s   | d kri S d S )N )settingsr   r   L/var/www/html/Darija-Ai-API/env/lib/python3.8/site-packages/yaml/__init__.pywarnings   s    r   c                 c   s0   || }z| r| V  q
W 5 |   X dS )z9
    Scan a YAML stream and produce scanning tokens.
    N)disposeZcheck_token	get_tokenstreamLoaderloaderr   r   r   scan   s
    r   c                 c   s0   || }z| r| V  q
W 5 |   X dS )z9
    Parse a YAML stream and produce parsing events.
    N)r   Zcheck_eventZ	get_eventr
   r   r   r   parse(   s
    r   c                 C   s$   || }z| W S |   X dS )zj
    Parse the first YAML document in a stream
    and produce the corresponding representation tree.
    N)r   Zget_single_noder
   r   r   r   compose3   s    r   c                 c   s0   || }z| r| V  q
W 5 |   X dS )zb
    Parse all YAML documents in a stream
    and produce corresponding representation trees.
    N)r   Z
check_nodeZget_noder
   r   r   r   compose_all>   s
    r   c                 C   s$   || }z| W S |   X dS )zd
    Parse the first YAML document in a stream
    and produce the corresponding Python object.
    N)r   Zget_single_datar
   r   r   r   loadJ   s    r   c                 c   s0   || }z| r| V  q
W 5 |   X dS )z\
    Parse all YAML documents in a stream
    and produce corresponding Python objects.
    N)r   Z
check_dataget_datar
   r   r   r   load_allU   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   
FullLoaderr   r   r   r   	full_loada   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_allk   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_loadu   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   s`   d}|dkrt  }|j}|||||||d}	z| D ]}
|	|
 q4W 5 |	  X |r\| 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getvaluer   emit)eventsr   Dumperr   r    r!   r"   r#   r&   dumpereventr   r   r   r'      s    
 
r'   c                 C   s   d}|dkr,|dkrt  }nt  }|j}|||||||||||	|
d}z(|  | D ]}|| qX|  W 5 |  X |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!   r"   r#   encodingversiontagsexplicit_startexplicit_end)r$   r%   BytesIOr&   r   open	serializeclose)nodesr   r)   r   r    r!   r"   r#   r,   r/   r0   r-   r.   r&   r*   noder   r   r   serialize_all   s.    	

    
r7   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.
    r)   )r7   )r6   r   r)   kwdsr   r   r   r3      s    r3   c                 C   s   d}|dkr,|
dkrt  }nt  }|j}|||||||||	|
|||||d}z(|  | D ]}|| q^|  W 5 |  X |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!   r"   r#   r,   r-   r.   r/   r0   	sort_keys)r$   r%   r1   r&   r   r2   Z	representr4   )	documentsr   r)   r9   r:   r   r    r!   r"   r#   r,   r/   r0   r-   r.   r;   r&   r*   datar   r   r   dump_all   s8    

       
r>   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.
    r)   )r>   )r=   r   r)   r8   r   r   r   dump   s    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.
    r)   r>   Z
SafeDumper)r<   r   r8   r   r   r   safe_dump_all   s    rA   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.
    r)   r@   )r=   r   r8   r   r   r   	safe_dump  s    rB   c                 C   sZ   |dk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   r)   r   r   r   rC     s    rC   c                 C   sZ   |dk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   )rD   pathkindr   r)   r   r   r   rG     s    rG   c                 C   sD   |dk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   )rD   constructorr   r   r   r   rJ   .  s
    rJ   c                 C   sD   |dk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   rL   ;  s
    rL   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representerr)   r   r   r   rM   I  s    rM   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)rN   Zmulti_representerr)   r   r   r   rO   R  s    rO   c                       s    e Zd ZdZ fddZ  ZS )YAMLObjectMetaclassz'
    The metaclass for YAMLObject.
    c                    sx   t t| ||| d|krt|d d k	rtt| jtrR| jD ]}|| j| j q:n| j| j| j | j	
| | j d S )Nyaml_tag)superrP   __init__
isinstanceyaml_loaderlistrJ   rQ   	from_yamlyaml_dumperrM   to_yaml)clsnamebasesr8   r   	__class__r   r   rS   _  s    
zYAMLObjectMetaclass.__init__)__name__
__module____qualname____doc__rS   __classcell__r   r   r]   r   rP   [  s   rP   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)rZ   r   r6   r   r   r   rW   x  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_objectrQ   yaml_flow_style)rZ   r*   r=   r   r   r   rY     s    zYAMLObject.to_yaml)r_   r`   ra   rb   	__slots__r   r   r   rU   r)   rX   rQ   re   classmethodrW   rY   r   r   r   r   rd   j  s   

rd   )	metaclass)N)N)N)N)N)*errortokensr(   r5   r   r*   __version__ZcyamlZ__with_libyaml__ImportErrorr$   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r)   r'   r7   r3   r>   r?   rA   rB   rC   rG   rJ   rL   rM   rO   typerP   rd   r   r   r   r   <module>   s   







   
      
        
!

 


		