B b�`r3�@sddlTddlTddlTddlTddlTddlTdZyddlTdZWne k r\dZYnXddl Z ddiZ dDdd �Z Gd d�de �Zd d �Zefd d�Zefdd�Zefdd�Zefdd�ZdEdd�ZdFdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zdedddddfd%d&�Zdeddddddddddf d'd(�Zdefd)d*�Z dedddddddddddddfd+d,�Z!defd-d.�Z"dGd/d0�Z#dHd1d2�Z$ddefd3d4�Z%ddefd5d6�Z&dId7d8�Z'dJd9d:�Z(efd;d<�Z)efd=d>�Z*Gd?d@�d@e+�Z,GdAdB�dBe,dC�Z-dS)K�)�*z5.4.1TF�N�YAMLLoadWarningcCs>|dkr tSt|�tkr:x |D]}|tkr||t|<qWdS)N)�_warnings_enabled�type�dict)Zsettings�key�r �@/opt/alt/python37/lib64/python3.7/site-packages/yaml/__init__.py�warningss   r c@s eZdZdS)rN)�__name__� __module__� __qualname__r r r r r(scCs4tddkrdSddl}d|}|j|tdd�dS)NrFrz�calling yaml.%s() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.�)� stacklevel)rr �warnr)�methodr �messager r r � load_warning+s  rccs4||�}zx|��r |��Vq WWd|��XdS)z9 Scan a YAML stream and produce scanning tokens. N)Z check_tokenZ get_token�dispose)�stream�Loader�loaderr r r �scan:s  rccs4||�}zx|��r |��Vq WWd|��XdS)z9 Parse a YAML stream and produce parsing events. N)Z check_eventZ get_eventr)rrrr r r �parseEs  rcCs ||�}z|��S|��XdS)zj Parse the first YAML document in a stream and produce the corresponding representation tree. N)Zget_single_noder)rrrr r r �composePsrccs4||�}zx|��r |��Vq WWd|��XdS)zb Parse all YAML documents in a stream and produce corresponding representation trees. N)Z check_nodeZget_noder)rrrr r r � compose_all[s  rcCs4|dkrtd�t}||�}z|��S|��XdS)zd Parse the first YAML document in a stream and produce the corresponding Python object. N�load)r� FullLoaderZget_single_datar)rrrr r r rgsrccsH|dkrtd�t}||�}zx|��r4|��Vq WWd|��XdS)z\ Parse all YAML documents in a stream and produce corresponding Python objects. N�load_all)rrZ check_data�get_datar)rrrr r r rvs rcCs 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. )rr)rr r r � full_load�sr!cCs 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. )rr)rr r r � full_load_all�sr"cCs 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� SafeLoader)rr r r � safe_load�sr$cCs 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. )rr#)rr r r � safe_load_all�sr%cCs 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� UnsafeLoader)rr r r � unsafe_load�sr'cCs 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. )rr&)rr r r �unsafe_load_all�sr(c Csdd}|dkrt��}|j}|||||||d�} zx|D]} | �| �q6WWd| ��X|r`|�SdS)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-r0�dumper�eventr r r r1�s    r1c  Cs�d} |dkr,|dkrt��}nt��}|j} ||||||||| | | | d� }z,|��x|D]}|�|�qZW|��Wd|��X| r�| �SdS)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/�BytesIOr0�open� serialize�closer)�nodesrr3r)r*r+r,r-r6r9r:r7r8r0r4�noder r r � serialize_all�s$       rAcKst|g|fd|i|��S)zx Serialize a representation tree into a YAML stream. If stream is None, return the produced string instead. r3)rA)r@rr3�kwdsr r r r=�sr=cCs�d}|dkr,| dkrt��}nt��}|j}||||||||| | | || | |d�}z,|��x|D]}|�|�q`W|��Wd|��X|r�|�SdS)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-r6r7r8r9r:� sort_keys)r.r/r;r0r<Z representr>r)� documentsrr3rCrDr)r*r+r,r-r6r9r:r7r8rEr0r4�datar r r �dump_all�s(      rHcKst|g|fd|i|��S)zr Serialize a Python object into a YAML stream. If stream is None, return the produced string instead. r3)rH)rGrr3rBr r r �dumpsrIcKst||fdti|��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. r3)rH� SafeDumper)rFrrBr r r � safe_dump_all$srKcKst|g|fdti|��S)z� Serialize a Python object into a YAML stream. Produce only basic YAML tags. If stream is None, return the produced string instead. r3)rHrJ)rGrrBr r r � safe_dump,srLcCsZ|dkr:tj�|||�tj�|||�tj�|||�n|�|||�|�|||�dS)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)rr�add_implicit_resolverrr&)�tagZregexp�firstrr3r r r rM4s rMcCsZ|dkr:tj�|||�tj�|||�tj�|||�n|�|||�|�|||�dS)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)rr�add_path_resolverrr&)rN�pathZkindrr3r r r rPDs rPcCsD|dkr4tj�||�tj�||�tj�||�n |�||�dS)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)rr�add_constructorrr&)rN� constructorrr r r rRSs rRcCsD|dkr4tj�||�tj�||�tj�||�n |�||�dS)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)rr�add_multi_constructorrr&)Z tag_prefixZmulti_constructorrr r r rT`s rTcCs|�||�dS)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 representerr3r r r rUnsrUcCs|�||�dS)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)rVZmulti_representerr3r r r rWwsrWcs eZdZdZ�fdd�Z�ZS)�YAMLObjectMetaclassz' The metaclass for YAMLObject. cs|tt|��|||�d|krx|ddk rxt|jt�rVx2|jD]}|�|j|j�qsn