mf`ddgZddlmZddlTddlTGddeZGddZdS)Composer ComposerError)MarkedYAMLError)*ceZdZdS)rN)__name__ __module__ __qualname__D/opt/imunify360/venv/lib64/python3.11/site-packages/yaml/composer.pyrrsDr cDeZdZdZdZdZdZdZdZdZ dZ d Z d S) rci|_dSN)anchorsselfs r __init__zComposer.__init__ s  r c|tr||t Sr) check_eventStreamStartEvent get_eventStreamEndEventrs r check_nodezComposer.check_nodesB   , - -  NN   ##N3333r cb|ts|SdSr)rrcompose_documentrs r get_nodezComposer.get_nodes4// +((** * + +r cJ|d}|ts|}|ts0|}t d|jd|j||S)Nz(expected a single document in the streamzbut found another document)rrrrr start_mark)rdocumentevents r get_single_nodezComposer.get_single_nodes // /,,..H// &NN$$E J')E$&& & r c||dd}|i|_|Sr)r compose_noder)rnodes r rzComposer.compose_document2sG   t,,   r c|trK|}|j}||jvrt ddd|z|j|j|S|}|j}|3||jvr*t d|z|j|jd|j||||tr| |}n_|tr| |}n/|tr||}||S)Nzfound undefined alias %rz+found duplicate anchor %r; first occurrencezsecond occurrence)r AliasEventranchorrrr peek_eventdescend_resolver ScalarEventcompose_scalar_nodeSequenceStartEventcompose_sequence_nodeMappingStartEventcompose_mapping_nodeascend_resolver)rparentindexr!r(r%s r r$zComposer.compose_node?sz   J ' ' (NN$$E\FT\))#D$0J 1!"'"2444<' '!!  %%#$Q %!"&,v"6"A+U-=??? fe,,,   K ( ( 5++F33DD   0 1 1 5--f55DD   / 0 0 5,,V44D  r c|}|j}||dkr&|t|j|j}t||j|j|j|j}| ||j |<|S)N!)style) rtagresolve ScalarNodevalueimplicitrend_markr6r)rr(r!r7r%s r r,zComposer.compose_scalar_nodeXs  i ;#**,,z5;GGC#u{ %. EEE  #'DL  r c|}|j}||dkr!|td|j}t|g|jd|j}| ||j|<d}|tsM|j | |||dz }|tM|}|j |_ |S)Nr5 flow_styler)rr7r8 SequenceNoder;rr?rrSequenceEndEventr:appendr$r<)rr( start_eventr7r%r3 end_events r r.zComposer.compose_sequence_nodecsnn&& o ;#**,,|T;3GHHCC&&1333  #'DL ""#344  J  d//e<< = = = QJE""#344 NN$$ !*  r c|}|j}||dkr!|td|j}t|g|jd|j}| ||j|<|tsb| |d}| ||}|j ||f|tb|}|j |_ |S)Nr5r>)rr7r8 MappingNoder;rr?rrMappingEndEventr$r:rCr<)rr(rDr7r%item_key item_valuerEs r r0zComposer.compose_mapping_nodeus nn&& o ;#**,,{D+2FGGC3&&1333  #'DL ""?33 6((t44H**4::J J  x4 5 5 5""?33 6NN$$ !*  r N) rr r rrrr"rr$r,r.r0r r r rr s444+++ *   2   $r N)__all__errorreventsnodesrrr r r rOs  '""""""     O   r