U mf0@sddlTddlTddlTddlTddlTddlTdZzddlTdZWne k r\dZYnXddl Z d@ddZ e fd d Z e fd d Ze fd dZe fddZddZddZddZddZddZddZddZdd Zdedddddfd!d"Zdeddddddddddf d#d$Zdefd%d&Zdedddddddddddddfd'd(Zdefd)d*ZdAd+d,ZdBd-d.Z ddefd/d0Z!ddefd1d2Z"dCd3d4Z#dDd5d6Z$efd7d8Z%efd9d:Z&Gd;d<dd>e(d?Z)dS)E)*z6.0.2TFNcCs|dkr iSdS)N)settingsrr=/opt/hc_python/lib64/python3.8/site-packages/yaml/__init__.pywarningssrccs0||}z|r|Vq W5|XdS)z9 Scan a YAML stream and produce scanning tokens. N)disposeZ check_token get_tokenstreamLoaderloaderrrrscans rccs0||}z|r|Vq W5|XdS)z9 Parse a YAML stream and produce parsing events. N)rZ check_eventZ get_eventr rrrparse(s rcCs$||}z |WS|XdS)zj Parse the first YAML document in a stream and produce the corresponding representation tree. N)rZget_single_noder rrrcompose3s rccs0||}z|r|Vq W5|XdS)zb Parse all YAML documents in a stream and produce corresponding representation trees. N)rZ check_nodeZget_noder rrr compose_all>s rcCs$||}z |WS|XdS)zd Parse the first YAML document in a stream and produce the corresponding Python object. N)rZget_single_datar rrrloadJs rccs0||}z|r|Vq W5|XdS)z\ Parse all YAML documents in a stream and produce corresponding Python objects. N)rZ check_dataget_datar rrrload_allUs rcCs t|tS)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 FullLoaderr rrr full_loadasrcCs t|tS)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. )rrrrrr full_load_allksrcCs t|tS)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 SafeLoaderrrrr safe_loadusrcCs t|tS)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. )rrrrrr safe_load_allsrcCs t|tS)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 UnsafeLoaderrrrr unsafe_loadsrcCs t|tS)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. )rrrrrrunsafe_load_allsrc Cs`d}|dkrt}|j}|||||||d} z|D]} | | q4W5| X|r\|SdS)zl Emit YAML parsing events into a stream. If stream is None, return the produced string instead. N) canonicalindentwidth allow_unicode line_break)ioStringIOgetvalueremit) eventsr Dumperrr r!r"r#r&dumpereventrrrr's  r'c  Csd} |dkr,|dkrt}nt}|j} ||||||||| | | | d }z(||D]}||qX|W5|X| r| SdS)z Serialize a sequence of representation trees into a YAML stream. If stream is None, return the produced string instead. N) rr r!r"r#encodingversiontagsexplicit_start explicit_end)r$r%BytesIOr&ropen serializeclose)nodesr r)rr r!r"r#r,r/r0r-r.r&r*noderrr serialize_alls.      r7cKst|g|fd|i|S)zx Serialize a representation tree into a YAML stream. If stream is None, return the produced string instead. r))r7)r6r r)kwdsrrrr3sr3cCsd}|dkr,| dkrt}nt}|j}||||||||| | | || | |d}z(||D]}||q^|W5|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_styledefault_flow_stylerr r!r"r#r,r-r.r/r0 sort_keys)r$r%r1r&rr2Z representr4) documentsr r)r9r:rr r!r"r#r,r/r0r-r.r;r&r*datarrrdump_alls8     r>cKst|g|fd|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)r8rrrdumpsr?cKst||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. r)r>Z SafeDumper)r<r r8rrr safe_dump_allsrAcKst|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. r)r@)r=r r8rrr safe_dumpsrBcCsZ|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)r r add_implicit_resolverrr)tagregexpfirstr r)rrrrCs rCcCsZ|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)r r add_path_resolverrr)rDpathkindr r)rrrrGs rGcCsD|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)r r add_constructorrr)rD constructorr rrrrJ.s rJcCsD|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)r r add_multi_constructorrr)Z tag_prefixZmulti_constructorr rrrrL;s rLcCs|||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 representerr)rrrrMIsrMcCs|||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)rNZmulti_representerr)rrrrORsrOcs eZdZdZfddZZS)YAMLObjectMetaclassz' The metaclass for YAMLObject. csxtt||||d|krt|ddk rtt|jtrR|jD]}||j|jq:n|j|j|j|j ||j dS)Nyaml_tag) superrP__init__ isinstance yaml_loaderlistrJrQ from_yaml yaml_dumperrMto_yaml)clsnamebasesr8r  __class__rrrS_s  zYAMLObjectMetaclass.__init__)__name__ __module__ __qualname____doc__rS __classcell__rrr]rrP[srPc@sBeZdZdZdZeeegZe Z dZ dZ e ddZe ddZdS) YAMLObjectza An object that can dump itself to a YAML stream and load itself from a YAML stream. rNcCs |||S)zC Convert a representation node to a Python object. )Zconstruct_yaml_object)rZr r6rrrrWxszYAMLObject.from_yamlcCs|j|j|||jdS)zC Convert a Python object to a representation node. )Z flow_style)Zrepresent_yaml_objectrQyaml_flow_style)rZr*r=rrrrYs zYAMLObject.to_yaml)r_r`rarb __slots__r rrrUr)rXrQre classmethodrWrYrrrrrdjs  rd) metaclass)N)N)N)N)N)*errortokensr(r5r r* __version__ZcyamlZ__with_libyaml__ ImportErrorr$rr rrrrrrrrrrrrr)r'r7r3r>r?rArBrCrGrJrLrMrOtyperPrdrrrrs              !