
    h                        S SK r S SKrS SKrS SKJr  S SKJrJr   " S S5      r	 " S S\	5      r
 " S S	\	5      r " S
 S\5      rS rS rS rS rg)    N)GraphMLWriter)edges_equalnodes_equalc                   $    \ rS rSr\S 5       rSrg)BaseGraphML
   c                 *   SU l         [        R                  " 5       U l        U R                  R	                  S5        U R                  R                  SSSS9  U R                  R                  SS5        U R                  R                  / SQ5        [        R                  " U R                   R                  S5      5      U l
        S	U l        [        R                  " S
S9U l        SS0U R                  R                  S'   U R                  R	                  SSS9  U R                  R	                  SSS9  U R                  R	                  SSS9  U R                  R	                  S5        U R                  R	                  SSS9  U R                  R                  SSSSS9  U R                  R                  SSSSS9  U R                  R                  SSSSS9  U R                  R                  SSSS9  U R                  R                  SSSS9  U R                  R                  SSSS9  U R                  R                  SSS S!S9  [        R                  " U R                  R                  S5      5      U l        S"U l        [        R                  " S
S9U l        S#S$S$S%S%S&S'.U R                   R                  S'   U R                   R	                  S5        U R                   R	                  S5        U R                   R                  SSSS9  [        R                  " U R                  R                  S5      5      U l        S(U l        [        R                  " 5       U l        U R&                  R	                  S)S*S+S,9  U R&                  R	                  S-S.S+S,9  U R&                  R                  S)S-S/S09  [        R                  " U R$                  R                  S5      5      nXl        S1U l        [        R                  " 5       U l        U R,                  R	                  SS2S39  U R,                  R	                  SSS39  U R,                  R                  SSS2S39  U R,                  R                  SSSS39  [        R                  " U R*                  R                  S5      5      nXl        S4U l        [        R2                  " 5       U l        U R4                  R	                  S5        U R4                  R                  SSSS9  U R4                  R                  S5S6/5        [        R                  " U R0                  R                  S5      5      nXl        S7U l        [        R:                  " 5       U l        U R<                  R	                  S5        U R<                  R                  SSSS9  U R<                  R                  SSSS9  U R<                  R                  SSSS9  [        R                  " U R8                  R                  S5      5      nXl        S8U l         [        R:                  " 5       U l!        U RB                  R	                  S5        U RB                  R                  SSSS9  U RB                  R                  SSSS9  U RB                  R                  SSSS9  [        R                  " U R@                  R                  S5      5      nXl"        S9U l#        [        R:                  " 5       U l$        U RH                  R	                  S5        U RH                  R                  SS5        U RH                  R                  SSSS9  U RH                  R                  SSSS9  [        R                  " U RF                  R                  S5      5      nXl%        g ):Na  <?xml version="1.0" encoding="UTF-8"?>
<!-- This file was written by the JAVA GraphML Library.-->
<graphml xmlns="http://graphml.graphdrawing.org/xmlns"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns
         http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
  <graph id="G" edgedefault="directed">
    <node id="n0"/>
    <node id="n1"/>
    <node id="n2"/>
    <node id="n3"/>
    <node id="n4"/>
    <node id="n5"/>
    <node id="n6"/>
    <node id="n7"/>
    <node id="n8"/>
    <node id="n9"/>
    <node id="n10"/>
    <edge id="foo" source="n0" target="n2"/>
    <edge source="n1" target="n2"/>
    <edge source="n2" target="n3"/>
    <edge source="n3" target="n5"/>
    <edge source="n3" target="n4"/>
    <edge source="n4" target="n6"/>
    <edge source="n6" target="n5"/>
    <edge source="n5" target="n7"/>
    <edge source="n6" target="n8"/>
    <edge source="n8" target="n7"/>
    <edge source="n8" target="n9"/>
  </graph>
</graphml>n10n0n2foo)id)
n1r   r   n3)r   n5)r   n4)r   n6)r   r   )r   n7)r   n8)r   r   )r   n9UTF-8a  <?xml version="1.0" encoding="UTF-8"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns
        http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
  <key id="d0" for="node" attr.name="color" attr.type="string">
    <default>yellow</default>
  </key>
  <key id="d1" for="edge" attr.name="weight" attr.type="double"/>
  <graph id="G" edgedefault="directed">
    <node id="n0">
      <data key="d0">green</data>
    </node>
    <node id="n1"/>
    <node id="n2">
      <data key="d0">blue</data>
    </node>
    <node id="n3">
      <data key="d0">red</data>
    </node>
    <node id="n4"/>
    <node id="n5">
      <data key="d0">turquoise</data>
    </node>
    <edge id="e0" source="n0" target="n2">
      <data key="d1">1.0</data>
    </edge>
    <edge id="e1" source="n0" target="n1">
      <data key="d1">1.0</data>
    </edge>
    <edge id="e2" source="n1" target="n3">
      <data key="d1">2.0</data>
    </edge>
    <edge id="e3" source="n3" target="n2"/>
    <edge id="e4" source="n2" target="n4"/>
    <edge id="e5" source="n3" target="n5"/>
    <edge id="e6" source="n5" target="n4">
      <data key="d1">1.1</data>
    </edge>
  </graph>
</graphml>
Gcoloryellownode_defaultgreen)r   bluer   redr   r   	turquoisee0g      ?)r   weightr   e1e2g       @e3e4e5e6皙?a  <?xml version="1.0" encoding="UTF-8"?>
        <graphml xmlns="http://graphml.graphdrawing.org/xmlns"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns
                http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
          <key id="d0" for="node" attr.name="boolean_attribute" attr.type="boolean"><default>false</default></key>
          <key id="d1" for="node" attr.name="int_attribute" attr.type="int"><default>0</default></key>
          <key id="d2" for="node" attr.name="long_attribute" attr.type="long"><default>0</default></key>
          <key id="d3" for="node" attr.name="float_attribute" attr.type="float"><default>0.0</default></key>
          <key id="d4" for="node" attr.name="double_attribute" attr.type="double"><default>0.0</default></key>
          <key id="d5" for="node" attr.name="string_attribute" attr.type="string"><default>Foo</default></key>
          <graph id="G" edgedefault="directed">
            <node id="n0"/>
            <node id="n1"/>
            <edge id="e0" source="n0" target="n1"/>
          </graph>
        </graphml>
        Fr   g        Foo)boolean_attributeint_attributelong_attributefloat_attributedouble_attributestring_attributeaV  <?xml version='1.0' encoding='utf-8'?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns
         http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
  <key id="edge_prop" for="edge" attr.name="edge_prop" attr.type="string"/>
  <key id="prop2" for="node" attr.name="prop2" attr.type="string"/>
  <key id="prop1" for="node" attr.name="prop1" attr.type="string"/>
  <graph edgedefault="directed">
    <node id="0">
      <data key="prop1">val1</data>
      <data key="prop2">val2</data>
    </node>
    <node id="1">
      <data key="prop1">val_one</data>
      <data key="prop2">val2</data>
    </node>
    <edge source="0" target="1">
      <data key="edge_prop">edge_value</data>
    </edge>
  </graph>
</graphml>
0val1val2)prop1prop21val_one
edge_value)	edge_propaC  <?xml version='1.0' encoding='utf-8'?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns
         http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
  <key attr.name="weight" attr.type="double" for="node" id="d1" />
  <key attr.name="weight" attr.type="double" for="edge" id="d0" />
  <graph edgedefault="directed">
    <node id="n0">
      <data key="d1">1</data>
    </node>
    <node id="n1">
      <data key="d1">2.0</data>
    </node>
    <edge source="n0" target="n1">
      <data key="d0">1</data>
    </edge>
    <edge source="n1" target="n0">
      <data key="d0">k</data>
    </edge>
    <edge source="n1" target="n1">
      <data key="d0">1.0</data>
    </edge>
  </graph>
</graphml>
   r#   a  <?xml version="1.0" encoding="UTF-8"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns
         http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
  <graph id="G">
    <node id="n0"/>
    <node id="n1"/>
    <node id="n2"/>
    <node id="n10"/>
    <edge id="foo" source="n0" target="n2"/>
    <edge source="n1" target="n2"/>
    <edge source="n2" target="n3"/>
  </graph>
</graphml>r   r   a  <?xml version="1.0" encoding="UTF-8"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns
         http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
  <graph id="G">
    <node id="n0"/>
    <node id="n1"/>
    <node id="n2"/>
    <node id="n10"/>
    <edge id="e0" source="n0" target="n2"/>
    <edge id="e1" source="n1" target="n2"/>
    <edge id="e2" source="n2" target="n1"/>
  </graph>
</graphml>a  <?xml version="1.0" encoding="UTF-8"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns
         http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
  <graph id="G">
    <node id="n0"/>
    <node id="n1"/>
    <node id="n2"/>
    <node id="n10"/>
    <edge id="e0" source="n0" target="n2"/>
    <edge id="e1" source="n1" target="n2"/>
    <edge id="e2" source="n2" target="n3"/>
  </graph>
</graphml>a  <?xml version="1.0" encoding="UTF-8"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns
         http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
  <graph id="G">
    <node id="n0"/>
    <node id="n1"/>
    <node id="n2"/>
    <node id="n10"/>
    <edge source="n0" target="n2"/>
    <edge id="e1" source="n1" target="n2"/>
    <edge id="e2" source="n2" target="n1"/>
  </graph>
</graphml>)&simple_directed_datanxDiGraphsimple_directed_graphadd_nodeadd_edgeadd_edges_fromioBytesIOencodesimple_directed_fhattribute_dataattribute_graphgraphattribute_fhnode_attribute_default_datanode_attribute_default_graphnode_attribute_default_fhattribute_named_key_ids_dataattribute_named_key_ids_graphattribute_named_key_ids_fhattribute_numeric_type_dataattribute_numeric_type_graphattribute_numeric_type_fhsimple_undirected_dataGraphsimple_undirected_graphsimple_undirected_fhundirected_multigraph_data
MultiGraphundirected_multigraphundirected_multigraph_fh'undirected_multigraph_no_multiedge_data"undirected_multigraph_no_multiedge%undirected_multigraph_no_multiedge_fh'multigraph_only_ids_for_multiedges_data"multigraph_only_ids_for_multiedges%multigraph_only_ids_for_multiedges_fh)clsfhs     W/var/www/html/env/lib/python3.13/site-packages/networkx/readwrite/tests/test_graphml.pysetup_classBaseGraphML.setup_class   s   $ > %'JJL!!!**51!!**4%*@!!**46!!00	
 "$C,D,D,K,KG,T!U)T !jjC05<h4G!!.1$$T$9$$T$8$$T$7$$T*$$T$=$$T4D$E$$T4D$E$$T4D$E$$T4D$9$$T4D$9$$T4D$9$$T4D$E::c&8&8&?&?&HI+'$ ,.::+=(!&" # %B
((..~> 	((11$7((11$7((11$1F(*

++227;)
%,(. -/JJL)))223fF2S))223iv2V))223|2TZZ88??HI)+&+'4 ,.::<(((11$q1A((11$s1C((11$Q1G((11$S1IZZ77>>wGH(*%&"  ')hhj###,,U3##,,T4E,B##22L,3OPZZ2299'BC#% *& %'MMO!!!**51!!**4$*?!!**4$*?!!**4$*?ZZ66==gFG')$73 24...77>..77dt7L..77dt7L..77dt7LZZCCJJ7ST46173 24...77>..77dC..77dt7L..77dt7LZZCCJJ7ST461     N)__name__
__module____qualname____firstlineno__classmethodrf   __static_attributes__ri   rh   re   r   r   
   s    j7 j7rh   r   c                       \ rS rSrS rS rS rS rS rS r	S r
S	 rS
 rS rS rS rS rS rS rS rS rS rSrg)TestReadGraphMLi9  c                 R   U R                   n[        R                  " U R                  5      n[	        UR                  5       5      [	        UR                  5       5      :X  d   e[	        UR                  5       5      [	        UR                  5       5      :X  d   e[	        UR                  SS95      [	        UR                  SS95      :X  d   eU R                  R                  S5        [        R                  " U R                  5      n[	        UR                  5       5      [	        UR                  5       5      :X  d   e[	        UR                  5       5      [	        UR                  5       5      :X  d   e[	        UR                  SS95      [	        UR                  SS95      :X  d   eg NTdatar   )
r@   r>   read_graphmlrG   sortednodesedgesseekparse_graphmlr=   selfr   HPGs       re   !test_read_simple_directed_graphml1TestReadGraphML.test_read_simple_directed_graphml:  s7   &&OOD334aggi F1779$5555aggi F1779$5555agg4g()VAGGG4F-GGGG$$Q'd778aggi F288:$6666aggi F288:$6666agg4g()VBHH$H4G-HHHHrh   c                 J   U R                   n[        R                  " U R                  5      n[	        UR                  5       UR                  5       5      (       d   e[        UR                  5       UR                  5       5      (       d   eU R                  R                  S5        [        R                  " U R                  5      n[	        UR                  5       UR                  5       5      (       d   e[        UR                  5       UR                  5       5      (       d   eg Nr   )rW   r>   rv   rX   r   rx   r   ry   rz   r{   rU   r|   s       re   #test_read_simple_undirected_graphml3TestReadGraphML.test_read_simple_undirected_graphmlG  s    ((OOD5561779aggi00001779aggi0000!!&&q)d99:1779bhhj11111779bhhj1111rh   c                 J   U R                   n[        R                  " U R                  5      n[	        UR                  5       UR                  5       5      (       d   e[        UR                  5       UR                  5       5      (       d   eU R                  R                  S5        [        R                  " U R                  5      n[	        UR                  5       UR                  5       5      (       d   e[        UR                  5       UR                  5       5      (       d   eg r   )r[   r>   rv   r\   r   rx   r   ry   rz   r{   rY   r|   s       re   'test_read_undirected_multigraph_graphml7TestReadGraphML.test_read_undirected_multigraph_graphmlR  s    &&OOD99:1779aggi00001779aggi0000%%**1-d==>1779bhhj11111779bhhj1111rh   c                 J   U R                   n[        R                  " U R                  5      n[	        UR                  5       UR                  5       5      (       d   e[        UR                  5       UR                  5       5      (       d   eU R                  R                  S5        [        R                  " U R                  5      n[	        UR                  5       UR                  5       5      (       d   e[        UR                  5       UR                  5       5      (       d   eg r   )r^   r>   rv   r_   r   rx   r   ry   rz   r{   r]   r|   s       re   4test_read_undirected_multigraph_no_multiedge_graphmlDTestReadGraphML.test_read_undirected_multigraph_no_multiedge_graphml]      33OODFFG1779aggi00001779aggi00002277:dJJK1779bhhj11111779bhhj1111rh   c                 J   U R                   n[        R                  " U R                  5      n[	        UR                  5       UR                  5       5      (       d   e[        UR                  5       UR                  5       5      (       d   eU R                  R                  S5        [        R                  " U R                  5      n[	        UR                  5       UR                  5       5      (       d   e[        UR                  5       UR                  5       5      (       d   eg r   )ra   r>   rv   rb   r   rx   r   ry   rz   r{   r`   r|   s       re   ?test_read_undirected_multigraph_only_ids_for_multiedges_graphmlOTestReadGraphML.test_read_undirected_multigraph_only_ids_for_multiedges_graphmlh  r   rh   c           	         U R                   n[        R                  " U R                  5      n[	        UR                  S5      [        UR                  SS95      5      (       d   e[        UR                  SS95      n[        UR                  SS95      n[        X45       H  u  pVXV:X  a  M   e   U R                  R                  S5        [        R                  " U R                  5      n[        UR                  S5      5      [        UR                  SS95      :X  d   e[        UR                  SS95      n[        UR                  SS95      n[        X45       H  u  pVXV:X  a  M   e   g rs   )rI   r>   rv   rK   r   rx   rw   ry   ziprz   r{   rH   )r}   r   r~   geheabr   s           re   test_read_attribute_graphml+TestReadGraphML.test_read_attribute_graphmls  s'     OOD--.1774=&d1C*DEEEEAGGG&'AGGG&'KDA6M6  q!d112aggdm$rxxTx/B(CCCCAGGG&'BHH$H'(KDA6M6  rh   c                     U R                   n[        R                  " U R                  5      nUR                  S   UR                  S   :X  d   eg )Nr   )rM   r>   rv   rN   rJ   )r}   r   r~   s      re   #test_node_default_attribute_graphml3TestReadGraphML.test_node_default_attribute_graphml  sA    --OOD::;ww~&!''.*AAAArh   c                 "   Sn[         R                  " UR                  S5      5      n[        R                  " [
        R                  [
        R                  U5        [        R                  " [
        R                  [
        R                  U5        g )Na  <?xml version="1.0" encoding="UTF-8"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns
         http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
  <graph id="G">
    <node id="n0"/>
    <node id="n1"/>
    <node id="n2"/>
    <edge source="n0" target="n1"/>
    <edge source="n1" target="n2" directed='true'/>
  </graph>
</graphml>r   	rD   rE   rF   pytestraisesr>   NetworkXErrorrv   r{   r}   srd   s      re    test_directed_edge_in_undirected0TestReadGraphML.test_directed_edge_in_undirected  X     ZZ)*b&&<b&&(8(8!<rh   c                 "   Sn[         R                  " UR                  S5      5      n[        R                  " [
        R                  [
        R                  U5        [        R                  " [
        R                  [
        R                  U5        g )Na  <?xml version="1.0" encoding="UTF-8"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns
         http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
  <graph id="G" edgedefault='directed'>
    <node id="n0"/>
    <node id="n1"/>
    <node id="n2"/>
    <edge source="n0" target="n1"/>
    <edge source="n1" target="n2" directed='false'/>
  </graph>
</graphml>r   r   r   s      re    test_undirected_edge_in_directed0TestReadGraphML.test_undirected_edge_in_directed  r   rh   c                 "   Sn[         R                  " UR                  S5      5      n[        R                  " [
        R                  [
        R                  U5        [        R                  " [
        R                  [
        R                  U5        g )Na  <?xml version="1.0" encoding="UTF-8"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns
         http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
  <key id="d0" for="node" attr.name="color" attr.type="string">
    <default>yellow</default>
  </key>
  <key id="d1" for="edge" attr.name="weight" attr.type="double"/>
  <graph id="G" edgedefault="directed">
    <node id="n0">
      <data key="d0">green</data>
    </node>
    <node id="n1"/>
    <node id="n2">
      <data key="d0">blue</data>
    </node>
    <edge id="e0" source="n0" target="n2">
      <data key="d2">1.0</data>
    </edge>
  </graph>
</graphml>
r   r   r   s      re   test_key_raiseTestReadGraphML.test_key_raise  sX    . ZZ)*b&&<b&&(8(8!<rh   c                 "   Sn[         R                  " UR                  S5      5      n[        R                  " [
        R                  [
        R                  U5        [        R                  " [
        R                  [
        R                  U5        g )Na5  <?xml version="1.0" encoding="UTF-8"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns
         http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
  <key id="d0" for="node" attr.name="color" attr.type="string">
    <default>yellow</default>
  </key>
  <key id="d1" for="edge" attr.name="weight" attr.type="double"/>
  <graph id="G" edgedefault="directed">
    <node id="n0">
      <data key="d0">green</data>
    </node>
    <node id="n1"/>
    <node id="n2">
      <data key="d0">blue</data>
    </node>
    <hyperedge id="e0" source="n0" target="n2">
       <endpoint node="n0"/>
       <endpoint node="n1"/>
       <endpoint node="n2"/>
    </hyperedge>
  </graph>
</graphml>
r   r   r   s      re   test_hyperedge_raise$TestReadGraphML.test_hyperedge_raise  sX    2 ZZ)*b&&<b&&(8(8!<rh   c                 L   Sn[         R                  " UR                  S5      5      n[        R                  " U5      nSS/n[        UR                  SS95      U:X  d   eUR                  S5        [        R                  " U5      n[        UR                  SS95      U:X  d   eg )Na  <?xml version="1.0" encoding="UTF-8"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns
         http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
  <graph id="G" edgedefault="directed">
    <node id="n0"/>
    <node id="n1"/>
    <edge id="e0" source="n0" target="n1"/>
    <edge id="e1" source="n0" target="n1"/>
  </graph>
</graphml>
r   )r   r   r"   )r   r   r$   Tkeysr   )	rD   rE   rF   r>   rv   rw   ry   rz   r{   r}   r   rd   r   expectedr~   s         re   test_multigraph_keys$TestReadGraphML.test_multigraph_keys  s     ZZ)*OOB&(:;agg4g()X555

Qagg4g()X555rh   c                    [         R                  " 5       nUR                  S5        UR                  S5        UR                  SSSSS04SSSS04SSSS	S
.4SSSSS04SSSSS04SSSSSS
.4/5        [        R
                  " 5       n[         R                  " X5        UR                  S5        [         R                  " U[        S9n[        UR                  SSS9UR                  SSS95      (       d   eUR                  UR                  :X  d   eUR                  R                  5        VVVVVV	s0 s Ho  u  pE[        U5      UR                  5        VVVV	s0 s H>  u  pg[        U5      UR                  5        VV	s0 s H  u  p[        U5      U	_M     sn	n_M@     sn	nnn_Mq     n
nnnnnn	UR                  S5        [         R                  " U[        [        S9nXR                  :X  d   eUR                  S5        UR                  5       n[         R                   " U[        [        S9nXR                  :X  d   egs  sn	nf s  sn	nnnf s  sn	nnnnnf )zN
Test that data and keys of edges are preserved on consequent
write and reads
r;      )r;   r   key	data_key1r   data_id2	data_key3data_id3)r   r   g   	data_key4h   data_id5i   	data_key6data_id7r   	node_typeT)ru   r   )r   edge_key_typeN)r>   rZ   rA   rC   rD   rE   write_graphmlrz   rv   intr   ry   _adjitemsstrreadr{   )r}   r   rd   r~   nodenbr_dictnbrkey_dictekeyddGadjHH	string_fhs                re   test_preserve_multi_edge_data-TestReadGraphML.test_preserve_multi_edge_data  s   
 MMO	

1	

1	 A{+,Aj)*A{*=>AsUK01AsT:./AsKzBC	
 ZZ\


OOB#.177478!''tRV':WXXXXvv #$&&,,.
 

 #1	 I%-^^%5%5MC C9IJ9IXT3t9b=9IJJ%5  #1 	 
 	
__R3cBww

GGI	i3cJww K
s*   4'I%I I&I 
IIIc                    Sn[         R                  " UR                  S5      5      n[        R                  " USS9n[        UR                  5       5      S/:X  d   eUR                  SSSS	9(       d   eUR                  S   S
   S:X  d   eUR                  S   S
   S:X  d   eUR                  S   S
   S:X  d   eUR                  S   S   S:X  d   eUR                  S   S   S:X  d   eUR                  S   S   S:X  d   eUR                  S   S   S:X  d   eUR                  S5        [        R                  " U5      n[        UR                  5       5      S/:X  d   eUS   S   S   S:X  d   eUR                  S   S
   S:X  d   eUR                  S   S
   S:X  d   eUR                  S   S
   S:X  d   eUR                  S   S   S:X  d   eUR                  S   S   S:X  d   eUR                  S   S   S:X  d   eUR                  S   S   S:X  d   e[        R                  " USS9n[        UR                  5       5      S/:X  d   eUR                  SSSS	9(       d   eUR                  S   S
   S:X  d   eUR                  S   S
   S:X  d   eUR                  S   S
   S:X  d   e[        R                  " U5      n[        UR                  5       5      S/:X  d   eUS   S   S   S:X  d   eUR                  S   S
   S:X  d   eUR                  S   S
   S:X  d   eUR                  S   S
   S:X  d   eg )NaI  <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:y="http://www.yworks.com/xml/graphml"
         xmlns:yed="http://www.yworks.com/xml/yed/3"
         xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns
         http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
  <!--Created by yFiles for Java 2.7-->
  <key for="graphml" id="d0" yfiles.type="resources"/>
  <key attr.name="url" attr.type="string" for="node" id="d1"/>
  <key attr.name="description" attr.type="string" for="node" id="d2"/>
  <key for="node" id="d3" yfiles.type="nodegraphics"/>
  <key attr.name="Description" attr.type="string" for="graph" id="d4">
    <default/>
  </key>
  <key attr.name="url" attr.type="string" for="edge" id="d5"/>
  <key attr.name="description" attr.type="string" for="edge" id="d6"/>
  <key for="edge" id="d7" yfiles.type="edgegraphics"/>
  <graph edgedefault="directed" id="G">
    <node id="n0">
      <data key="d3">
        <y:ShapeNode>
          <y:Geometry height="30.0" width="30.0" x="125.0" y="100.0"/>
          <y:Fill color="#FFCC00" transparent="false"/>
          <y:BorderStyle color="#000000" type="line" width="1.0"/>
          <y:NodeLabel alignment="center" autoSizePolicy="content"
           borderDistance="0.0" fontFamily="Dialog" fontSize="13"
           fontStyle="plain" hasBackgroundColor="false" hasLineColor="false"
           height="19.1328125" modelName="internal" modelPosition="c"
           textColor="#000000" visible="true" width="12.27099609375"
           x="8.864501953125" y="5.43359375">1</y:NodeLabel>
          <y:Shape type="rectangle"/>
        </y:ShapeNode>
      </data>
    </node>
    <node id="n1">
      <data key="d3">
        <y:ShapeNode>
          <y:Geometry height="30.0" width="30.0" x="183.0" y="205.0"/>
          <y:Fill color="#FFCC00" transparent="false"/>
          <y:BorderStyle color="#000000" type="line" width="1.0"/>
          <y:NodeLabel alignment="center" autoSizePolicy="content"
          borderDistance="0.0" fontFamily="Dialog" fontSize="13"
          fontStyle="plain" hasBackgroundColor="false" hasLineColor="false"
          height="19.1328125" modelName="internal" modelPosition="c"
          textColor="#000000" visible="true" width="12.27099609375"
          x="8.864501953125" y="5.43359375">2</y:NodeLabel>
          <y:Shape type="rectangle"/>
        </y:ShapeNode>
      </data>
    </node>
    <node id="n2">
      <data key="d6" xml:space="preserve"><![CDATA[description
line1
line2]]></data>
      <data key="d3">
        <y:GenericNode configuration="com.yworks.flowchart.terminator">
          <y:Geometry height="40.0" width="80.0" x="950.0" y="286.0"/>
          <y:Fill color="#E8EEF7" color2="#B7C9E3" transparent="false"/>
          <y:BorderStyle color="#000000" type="line" width="1.0"/>
          <y:NodeLabel alignment="center" autoSizePolicy="content"
          fontFamily="Dialog" fontSize="12" fontStyle="plain"
          hasBackgroundColor="false" hasLineColor="false" height="17.96875"
          horizontalTextPosition="center" iconTextGap="4" modelName="custom"
          textColor="#000000" verticalTextPosition="bottom" visible="true"
          width="67.984375" x="6.0078125" xml:space="preserve"
          y="11.015625">3<y:LabelModel>
          <y:SmartNodeLabelModel distance="4.0"/></y:LabelModel>
          <y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0"
          labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0"
          offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
        </y:GenericNode>
      </data>
    </node>
    <edge id="e0" source="n0" target="n1">
      <data key="d7">
        <y:PolyLineEdge>
          <y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0"/>
          <y:LineStyle color="#000000" type="line" width="1.0"/>
          <y:Arrows source="none" target="standard"/>
          <y:BendStyle smoothed="false"/>
        </y:PolyLineEdge>
      </data>
    </edge>
  </graph>
  <data key="d0">
    <y:Resources/>
  </data>
</graphml>
r   Tforce_multigraph)r   r   r   r   r"   )r   labelr7   2r   3
shape_type	rectanglezcom.yworks.flowchart.terminatordescriptionzdescription
line1
line2r   r   )rD   rE   rF   r>   rv   listry   has_edgerx   rz   r{   )r}   ru   rd   r   r~   s        re   test_yfiles_extension%TestReadGraphML.test_yfiles_extension+  s]   Yt ZZG,-OOB6AGGI<.000zz$$z///wwt}W%,,,wwt}W%,,,wwt}W%,,,wwt}\*k999wwt}\*k999wwt}\*.OOOOwwt}]+/JJJJ

OOBAGGI<.000wt}T"d***wwt}W%,,,wwt}W%,,,wwt}W%,,,wwt}\*k999wwt}\*k999wwt}\*.OOOOwwt}]+/JJJJTD9AGGI<.000zz$$z///wwt}W%,,,wwt}W%,,,wwt}W%,,,T"AGGI<.000wt}T"d***wwt}W%,,,wwt}W%,,,wwt}W%,,,rh   c                    Sn[         R                  " UR                  S5      5      n[        R                  " U5      n[        R
                  " U5      nX44 H  nUR                  S   S   (       d   eUR                  S   S   (       a   eUR                  S   S   (       a   eUR                  S   S   (       d   eUR                  S   S   (       a   eUR                  S	   S   (       a  M   e   g )
NaU  <?xml version="1.0" encoding="UTF-8"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns
         http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
  <key id="d0" for="node" attr.name="test" attr.type="boolean">
    <default>false</default>
  </key>
  <graph id="G" edgedefault="directed">
    <node id="n0">
      <data key="d0">true</data>
    </node>
    <node id="n1"/>
    <node id="n2">
      <data key="d0">false</data>
    </node>
    <node id="n3">
      <data key="d0">FaLsE</data>
    </node>
    <node id="n4">
      <data key="d0">True</data>
    </node>
    <node id="n5">
      <data key="d0">0</data>
    </node>
    <node id="n6">
      <data key="d0">1</data>
    </node>
  </graph>
</graphml>
r   r   testr   r   r   r   r   )rD   rE   rF   r>   rv   r{   rx   )r}   r   rd   r   r~   rJ   s         re   	test_boolTestReadGraphML.test_bool  s    > ZZ)*OOBQVE;;t$V,,,{{4(000{{4(000;;t$V,,,{{4(000;;t$V,,,, rh   c                 &   SnSnSnX4 Hw  n[         R                  " UR                  S5      5      n[        R                  " U5      n[        R
                  " U5      nXg4 H  nUR                  S   S   (       a  M   e   My     [         R                  " UR                  S5      5      n[        R                  " [        R                  [        R                  U5        [        R                  " [        R                  [        R
                  U5        g )Na  <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns
         http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
  <key id="d0" for="node" attr.name="test" attr.type="boolean">
    <default>false</default>
  </key>
  <graph id="G">
    <node id="n0">
      <data key="d0">true</data>
    </node>
  </graph>
</graphml>
a  <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<graphml>
  <key id="d0" for="node" attr.name="test" attr.type="boolean">
    <default>false</default>
  </key>
  <graph id="G">
    <node id="n0">
      <data key="d0">true</data>
    </node>
  </graph>
</graphml>
a%  <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<graphml xmlns="https://ghghgh">
  <key id="d0" for="node" attr.name="test" attr.type="boolean">
    <default>false</default>
  </key>
  <graph id="G">
    <node id="n0">
      <data key="d0">true</data>
    </node>
  </graph>
</graphml>
r   r   r   )
rD   rE   rF   r>   rv   r{   rx   r   r   r   )	r}   goodbaduglyr   rd   r   r~   rJ   s	            re   test_graphml_header_line(TestReadGraphML.test_graphml_header_line  s     AAHHW-.B#A  #A{{4(0000  	  ZZG,-b&&<b&&(8(8$?rh   c                    Sn[         R                  " UR                  S5      5      n[        R                  " U5      nUR                  SS9 VVs/ s H  u  pEUPM	     nnn[        U5      S:X  d   eU H  nUS   S:w  a  M   e   g s  snnf )NaI  <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:java="http://www.yworks.com/xml/yfiles-common/1.0/java" xmlns:sys="http://www.yworks.com/xml/yfiles-common/markup/primitives/2.0" xmlns:x="http://www.yworks.com/xml/yfiles-common/markup/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:y="http://www.yworks.com/xml/graphml" xmlns:yed="http://www.yworks.com/xml/yed/3" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://www.yworks.com/xml/schema/graphml/1.1/ygraphml.xsd">
  <!--Created by yEd 3.17-->
  <key attr.name="Description" attr.type="string" for="graph" id="d0"/>
  <key for="port" id="d1" yfiles.type="portgraphics"/>
  <key for="port" id="d2" yfiles.type="portgeometry"/>
  <key for="port" id="d3" yfiles.type="portuserdata"/>
  <key attr.name="CustomProperty" attr.type="string" for="node" id="d4">
    <default/>
  </key>
  <key attr.name="url" attr.type="string" for="node" id="d5"/>
  <key attr.name="description" attr.type="string" for="node" id="d6"/>
  <key for="node" id="d7" yfiles.type="nodegraphics"/>
  <key for="graphml" id="d8" yfiles.type="resources"/>
  <key attr.name="url" attr.type="string" for="edge" id="d9"/>
  <key attr.name="description" attr.type="string" for="edge" id="d10"/>
  <key for="edge" id="d11" yfiles.type="edgegraphics"/>
  <graph edgedefault="directed" id="G">
    <data key="d0"/>
    <node id="n0">
      <data key="d4"><![CDATA[CustomPropertyValue]]></data>
      <data key="d6"/>
      <data key="d7">
        <y:ShapeNode>
          <y:Geometry height="30.0" width="30.0" x="125.0" y="-255.4611111111111"/>
          <y:Fill color="#FFCC00" transparent="false"/>
          <y:BorderStyle color="#000000" raised="false" type="line" width="1.0"/>
          <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.96875" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="11.634765625" x="9.1826171875" y="6.015625">2<y:LabelModel>
              <y:SmartNodeLabelModel distance="4.0"/>
            </y:LabelModel>
            <y:ModelParameter>
              <y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/>
            </y:ModelParameter>
          </y:NodeLabel>
          <y:Shape type="rectangle"/>
        </y:ShapeNode>
      </data>
    </node>
    <node id="n1" yfiles.foldertype="group">
      <data key="d4"><![CDATA[CustomPropertyValue]]></data>
      <data key="d5"/>
      <data key="d6"/>
      <data key="d7">
        <y:ProxyAutoBoundsNode>
          <y:Realizers active="0">
            <y:GroupNode>
              <y:Geometry height="250.38333333333333" width="140.0" x="-30.0" y="-330.3833333333333"/>
              <y:Fill color="#F5F5F5" transparent="false"/>
              <y:BorderStyle color="#000000" type="dashed" width="1.0"/>
              <y:NodeLabel alignment="right" autoSizePolicy="node_width" backgroundColor="#EBEBEB" borderDistance="0.0" fontFamily="Dialog" fontSize="15" fontStyle="plain" hasLineColor="false" height="21.4609375" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="t" textColor="#000000" verticalTextPosition="bottom" visible="true" width="140.0" x="0.0" y="0.0">Group 3</y:NodeLabel>
              <y:Shape type="roundrectangle"/>
              <y:State closed="false" closedHeight="50.0" closedWidth="50.0" innerGraphDisplayEnabled="false"/>
              <y:Insets bottom="15" bottomF="15.0" left="15" leftF="15.0" right="15" rightF="15.0" top="15" topF="15.0"/>
              <y:BorderInsets bottom="1" bottomF="1.0" left="0" leftF="0.0" right="0" rightF="0.0" top="1" topF="1.0001736111111086"/>
            </y:GroupNode>
            <y:GroupNode>
              <y:Geometry height="50.0" width="50.0" x="0.0" y="60.0"/>
              <y:Fill color="#F5F5F5" transparent="false"/>
              <y:BorderStyle color="#000000" type="dashed" width="1.0"/>
              <y:NodeLabel alignment="right" autoSizePolicy="node_width" backgroundColor="#EBEBEB" borderDistance="0.0" fontFamily="Dialog" fontSize="15" fontStyle="plain" hasLineColor="false" height="21.4609375" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="t" textColor="#000000" verticalTextPosition="bottom" visible="true" width="65.201171875" x="-7.6005859375" y="0.0">Folder 3</y:NodeLabel>
              <y:Shape type="roundrectangle"/>
              <y:State closed="true" closedHeight="50.0" closedWidth="50.0" innerGraphDisplayEnabled="false"/>
              <y:Insets bottom="5" bottomF="5.0" left="5" leftF="5.0" right="5" rightF="5.0" top="5" topF="5.0"/>
              <y:BorderInsets bottom="0" bottomF="0.0" left="0" leftF="0.0" right="0" rightF="0.0" top="0" topF="0.0"/>
            </y:GroupNode>
          </y:Realizers>
        </y:ProxyAutoBoundsNode>
      </data>
      <graph edgedefault="directed" id="n1:">
        <node id="n1::n0" yfiles.foldertype="group">
          <data key="d4"><![CDATA[CustomPropertyValue]]></data>
          <data key="d5"/>
          <data key="d6"/>
          <data key="d7">
            <y:ProxyAutoBoundsNode>
              <y:Realizers active="0">
                <y:GroupNode>
                  <y:Geometry height="83.46111111111111" width="110.0" x="-15.0" y="-292.9222222222222"/>
                  <y:Fill color="#F5F5F5" transparent="false"/>
                  <y:BorderStyle color="#000000" type="dashed" width="1.0"/>
                  <y:NodeLabel alignment="right" autoSizePolicy="node_width" backgroundColor="#EBEBEB" borderDistance="0.0" fontFamily="Dialog" fontSize="15" fontStyle="plain" hasLineColor="false" height="21.4609375" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="t" textColor="#000000" verticalTextPosition="bottom" visible="true" width="110.0" x="0.0" y="0.0">Group 1</y:NodeLabel>
                  <y:Shape type="roundrectangle"/>
                  <y:State closed="false" closedHeight="50.0" closedWidth="50.0" innerGraphDisplayEnabled="false"/>
                  <y:Insets bottom="15" bottomF="15.0" left="15" leftF="15.0" right="15" rightF="15.0" top="15" topF="15.0"/>
                  <y:BorderInsets bottom="1" bottomF="1.0" left="0" leftF="0.0" right="0" rightF="0.0" top="1" topF="1.0001736111111086"/>
                </y:GroupNode>
                <y:GroupNode>
                  <y:Geometry height="50.0" width="50.0" x="0.0" y="60.0"/>
                  <y:Fill color="#F5F5F5" transparent="false"/>
                  <y:BorderStyle color="#000000" type="dashed" width="1.0"/>
                  <y:NodeLabel alignment="right" autoSizePolicy="node_width" backgroundColor="#EBEBEB" borderDistance="0.0" fontFamily="Dialog" fontSize="15" fontStyle="plain" hasLineColor="false" height="21.4609375" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="t" textColor="#000000" verticalTextPosition="bottom" visible="true" width="65.201171875" x="-7.6005859375" y="0.0">Folder 1</y:NodeLabel>
                  <y:Shape type="roundrectangle"/>
                  <y:State closed="true" closedHeight="50.0" closedWidth="50.0" innerGraphDisplayEnabled="false"/>
                  <y:Insets bottom="5" bottomF="5.0" left="5" leftF="5.0" right="5" rightF="5.0" top="5" topF="5.0"/>
                  <y:BorderInsets bottom="0" bottomF="0.0" left="0" leftF="0.0" right="0" rightF="0.0" top="0" topF="0.0"/>
                </y:GroupNode>
              </y:Realizers>
            </y:ProxyAutoBoundsNode>
          </data>
          <graph edgedefault="directed" id="n1::n0:">
            <node id="n1::n0::n0">
              <data key="d4"><![CDATA[CustomPropertyValue]]></data>
              <data key="d6"/>
              <data key="d7">
                <y:ShapeNode>
                  <y:Geometry height="30.0" width="30.0" x="50.0" y="-255.4611111111111"/>
                  <y:Fill color="#FFCC00" transparent="false"/>
                  <y:BorderStyle color="#000000" raised="false" type="line" width="1.0"/>
                  <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.96875" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="11.634765625" x="9.1826171875" y="6.015625">1<y:LabelModel>
                      <y:SmartNodeLabelModel distance="4.0"/>
                    </y:LabelModel>
                    <y:ModelParameter>
                      <y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/>
                    </y:ModelParameter>
                  </y:NodeLabel>
                  <y:Shape type="rectangle"/>
                </y:ShapeNode>
              </data>
            </node>
            <node id="n1::n0::n1">
              <data key="d4"><![CDATA[CustomPropertyValue]]></data>
              <data key="d6"/>
              <data key="d7">
                <y:ShapeNode>
                  <y:Geometry height="30.0" width="30.0" x="0.0" y="-255.4611111111111"/>
                  <y:Fill color="#FFCC00" transparent="false"/>
                  <y:BorderStyle color="#000000" raised="false" type="line" width="1.0"/>
                  <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.96875" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="11.634765625" x="9.1826171875" y="6.015625">3<y:LabelModel>
                      <y:SmartNodeLabelModel distance="4.0"/>
                    </y:LabelModel>
                    <y:ModelParameter>
                      <y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/>
                    </y:ModelParameter>
                  </y:NodeLabel>
                  <y:Shape type="rectangle"/>
                </y:ShapeNode>
              </data>
            </node>
          </graph>
        </node>
        <node id="n1::n1" yfiles.foldertype="group">
          <data key="d4"><![CDATA[CustomPropertyValue]]></data>
          <data key="d5"/>
          <data key="d6"/>
          <data key="d7">
            <y:ProxyAutoBoundsNode>
              <y:Realizers active="0">
                <y:GroupNode>
                  <y:Geometry height="83.46111111111111" width="110.0" x="-15.0" y="-179.4611111111111"/>
                  <y:Fill color="#F5F5F5" transparent="false"/>
                  <y:BorderStyle color="#000000" type="dashed" width="1.0"/>
                  <y:NodeLabel alignment="right" autoSizePolicy="node_width" backgroundColor="#EBEBEB" borderDistance="0.0" fontFamily="Dialog" fontSize="15" fontStyle="plain" hasLineColor="false" height="21.4609375" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="t" textColor="#000000" verticalTextPosition="bottom" visible="true" width="110.0" x="0.0" y="0.0">Group 2</y:NodeLabel>
                  <y:Shape type="roundrectangle"/>
                  <y:State closed="false" closedHeight="50.0" closedWidth="50.0" innerGraphDisplayEnabled="false"/>
                  <y:Insets bottom="15" bottomF="15.0" left="15" leftF="15.0" right="15" rightF="15.0" top="15" topF="15.0"/>
                  <y:BorderInsets bottom="1" bottomF="1.0" left="0" leftF="0.0" right="0" rightF="0.0" top="1" topF="1.0001736111111086"/>
                </y:GroupNode>
                <y:GroupNode>
                  <y:Geometry height="50.0" width="50.0" x="0.0" y="60.0"/>
                  <y:Fill color="#F5F5F5" transparent="false"/>
                  <y:BorderStyle color="#000000" type="dashed" width="1.0"/>
                  <y:NodeLabel alignment="right" autoSizePolicy="node_width" backgroundColor="#EBEBEB" borderDistance="0.0" fontFamily="Dialog" fontSize="15" fontStyle="plain" hasLineColor="false" height="21.4609375" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="t" textColor="#000000" verticalTextPosition="bottom" visible="true" width="65.201171875" x="-7.6005859375" y="0.0">Folder 2</y:NodeLabel>
                  <y:Shape type="roundrectangle"/>
                  <y:State closed="true" closedHeight="50.0" closedWidth="50.0" innerGraphDisplayEnabled="false"/>
                  <y:Insets bottom="5" bottomF="5.0" left="5" leftF="5.0" right="5" rightF="5.0" top="5" topF="5.0"/>
                  <y:BorderInsets bottom="0" bottomF="0.0" left="0" leftF="0.0" right="0" rightF="0.0" top="0" topF="0.0"/>
                </y:GroupNode>
              </y:Realizers>
            </y:ProxyAutoBoundsNode>
          </data>
          <graph edgedefault="directed" id="n1::n1:">
            <node id="n1::n1::n0">
              <data key="d4"><![CDATA[CustomPropertyValue]]></data>
              <data key="d6"/>
              <data key="d7">
                <y:ShapeNode>
                  <y:Geometry height="30.0" width="30.0" x="0.0" y="-142.0"/>
                  <y:Fill color="#FFCC00" transparent="false"/>
                  <y:BorderStyle color="#000000" raised="false" type="line" width="1.0"/>
                  <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.96875" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="11.634765625" x="9.1826171875" y="6.015625">5<y:LabelModel>
                      <y:SmartNodeLabelModel distance="4.0"/>
                    </y:LabelModel>
                    <y:ModelParameter>
                      <y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/>
                    </y:ModelParameter>
                  </y:NodeLabel>
                  <y:Shape type="rectangle"/>
                </y:ShapeNode>
              </data>
            </node>
            <node id="n1::n1::n1">
              <data key="d4"><![CDATA[CustomPropertyValue]]></data>
              <data key="d6"/>
              <data key="d7">
                <y:ShapeNode>
                  <y:Geometry height="30.0" width="30.0" x="50.0" y="-142.0"/>
                  <y:Fill color="#FFCC00" transparent="false"/>
                  <y:BorderStyle color="#000000" raised="false" type="line" width="1.0"/>
                  <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.96875" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="11.634765625" x="9.1826171875" y="6.015625">6<y:LabelModel>
                      <y:SmartNodeLabelModel distance="4.0"/>
                    </y:LabelModel>
                    <y:ModelParameter>
                      <y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/>
                    </y:ModelParameter>
                  </y:NodeLabel>
                  <y:Shape type="rectangle"/>
                </y:ShapeNode>
              </data>
            </node>
          </graph>
        </node>
      </graph>
    </node>
    <node id="n2">
      <data key="d4"><![CDATA[CustomPropertyValue]]></data>
      <data key="d6"/>
      <data key="d7">
        <y:ShapeNode>
          <y:Geometry height="30.0" width="30.0" x="125.0" y="-142.0"/>
          <y:Fill color="#FFCC00" transparent="false"/>
          <y:BorderStyle color="#000000" raised="false" type="line" width="1.0"/>
          <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.96875" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="11.634765625" x="9.1826171875" y="6.015625">9<y:LabelModel>
              <y:SmartNodeLabelModel distance="4.0"/>
            </y:LabelModel>
            <y:ModelParameter>
              <y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/>
            </y:ModelParameter>
          </y:NodeLabel>
          <y:Shape type="rectangle"/>
        </y:ShapeNode>
      </data>
    </node>
    <edge id="n1::n1::e0" source="n1::n1::n0" target="n1::n1::n1">
      <data key="d10"/>
      <data key="d11">
        <y:PolyLineEdge>
          <y:Path sx="15.0" sy="-0.0" tx="-15.0" ty="-0.0"/>
          <y:LineStyle color="#000000" type="line" width="1.0"/>
          <y:Arrows source="none" target="standard"/>
          <y:BendStyle smoothed="false"/>
        </y:PolyLineEdge>
      </data>
    </edge>
    <edge id="n1::n0::e0" source="n1::n0::n1" target="n1::n0::n0">
      <data key="d10"/>
      <data key="d11">
        <y:PolyLineEdge>
          <y:Path sx="15.0" sy="-0.0" tx="-15.0" ty="-0.0"/>
          <y:LineStyle color="#000000" type="line" width="1.0"/>
          <y:Arrows source="none" target="standard"/>
          <y:BendStyle smoothed="false"/>
        </y:PolyLineEdge>
      </data>
    </edge>
    <edge id="e0" source="n1::n0::n0" target="n0">
      <data key="d10"/>
      <data key="d11">
        <y:PolyLineEdge>
          <y:Path sx="15.0" sy="-0.0" tx="-15.0" ty="-0.0"/>
          <y:LineStyle color="#000000" type="line" width="1.0"/>
          <y:Arrows source="none" target="standard"/>
          <y:BendStyle smoothed="false"/>
        </y:PolyLineEdge>
      </data>
    </edge>
    <edge id="e1" source="n1::n1::n1" target="n2">
      <data key="d10"/>
      <data key="d11">
        <y:PolyLineEdge>
          <y:Path sx="15.0" sy="-0.0" tx="-15.0" ty="-0.0"/>
          <y:LineStyle color="#000000" type="line" width="1.0"/>
          <y:Arrows source="none" target="standard"/>
          <y:BendStyle smoothed="false"/>
        </y:PolyLineEdge>
      </data>
    </edge>
  </graph>
  <data key="d8">
    <y:Resources/>
  </data>
</graphml>
r   Trt   	   CustomProperty )rD   rE   rF   r>   rv   rx   len)r}   ru   rd   r   _x	node_datas          re    test_read_attributes_with_groups0TestReadGraphML.test_read_attributes_with_groups	  s    Zx ZZG,-OOBgg4g010da014yA~~I-."444  2s   Bc                 R   Sn[         R                  " UR                  S5      5      n[        R                  " U5      nSSS04/n[        UR                  SS95      U:X  d   eUR                  S5        [        R                  " U5      n[        UR                  SS95      U:X  d   eg )	Na  <?xml version='1.0' encoding='utf-8'?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns
         http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
  <key attr.name="cudfversion" attr.type="long" for="node" id="d6" />
  <graph edgedefault="directed">
    <node id="n1">
      <data key="d6">4284</data>
    </node>
  </graph>
</graphml>r   r   cudfversioni  Trt   r   )	rD   rE   rF   r>   rv   rw   rx   rz   r{   r   s         re   test_long_attribute_type(TestReadGraphML.test_long_attribute_type-  s     ZZ)*OOBM4012agg4g()X555

Qagg4g()X555rh   ri   N)rj   rk   rl   rm   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   ro   ri   rh   re   rq   rq   9  sf    I	2	2	2	2"B
=$=$=8=<6.+Z~-@)-V1@fb5H	6rh   rq   c                       \ rS rSr\" \R                  5      r\S 5       r	S r
S rS rS rS rS rS	 rS
 rS rS rS rS rS rS rS rS rS rS rS rSrg)TestWriteGraphMLiE  c                 X    [         R                  5         [        R                  " S5      ng )N
lxml.etree)r   rf   r   importorskip)rc   r   s     re   rf   TestWriteGraphML.setup_classH  s    !-rh   c                      SS K n[        R                  [        R                  :X  d   eg ! [         a'    [        R                  [        R
                  :X  d   e g f = fr   )
lxml.etreer>   r   write_graphml_lxmlImportErrorwrite_graphml_xml)r}   lxmls     re   test_write_interface%TestWriteGraphML.test_write_interfaceM  sM    	<##r'<'<<<< 	<##r';';;;;	<s   (+ .AAc                 J   U R                   nSUR                  S'   [        R                  " 5       nU R	                  X5        UR                  S5        [        R                  " U5      n[        UR                  5       5      [        UR                  5       5      :X  d   e[        UR                  5       5      [        UR                  5       5      :X  d   e[        UR                  SS95      [        UR                  SS95      :X  d   eU R                  R                  S5        g )Ntherehir   Trt   r@   rJ   rD   rE   writerrz   r>   rv   rw   rx   ry   rG   r}   r   rd   r~   s       re   'test_write_read_simple_directed_graphml8TestWriteGraphML.test_write_read_simple_directed_graphmlU  s    &&ZZ\A

OOBaggi F1779$5555aggi F1779$5555agg4g()VAGGG4F-GGGG$$Q'rh   c                 t    [        5       nU R                  nUR                  5       nUR                  X#/5        g N)r   r@   copy
add_graphs)r}   gmlwr   r~   s       re   test_GraphMLWriter_add_graphs.TestWriteGraphML.test_GraphMLWriter_add_graphsa  s-    &&FFHrh   c                 f   U R                   nSUR                  S'   SUR                  S'   [        R                  " 5       nU R	                  XSS9  UR                  S5        [        R                  " U5      n[        UR                  5       5      [        UR                  5       5      :X  d   e[        UR                  5       5      [        UR                  5       5      :X  d   e[        UR                  SS	95      [        UR                  SS	95      :X  d   eU R                  R                  S5        g )
Nr  r  r7   r   F)prettyprintr   Trt   r  r  s       re   %test_write_read_simple_no_prettyprint6TestWriteGraphML.test_write_read_simple_no_prettyprintg  s    &&ZZ\Au-

OOBaggi F1779$5555aggi F1779$5555agg4g()VAGGG4F-GGGG$$Q'rh   c                    SSK Jn  U R                  n[        R                  " 5       nU R                  X#SS9  UR                  S5        [        R                  " U5      nUR                  S5        [        UR                  5       UR                  5       5      (       d   e[        UR                  5       UR                  5       5      (       d   e[        UR                  SS9UR                  SS95      (       d   eU R                  R                  S5        U" U5      n[        UR                  5       5      n[!        U5      S:X  d   eUS S  Vs/ s H  owR#                  5       PM     nn[!        U5      S:X  d   eSUS   ;   d   eS	US   ;   d   eS
US   ;   d   eSUS   ;   d   eSUS   ;   d   eSUS   ;   d   e[        R                  " 5       n	[        R$                  " X)5        U	R                  S5        [        R                  " U	5      n[        R                  " 5       n
[        R$                  " X*SS9  U
R                  S5        [        R                  " U
5      n['        S [)        UR                  UR                  5       5       5      (       d   e['        S [)        UR                  UR                  5       5       5      (       d   eg s  snf )Nr   parseT)named_key_idsrt         )r   r:   )	attr.namer:   )r   r6   r;   )r#  r6   )r   r5   r   )r#  r5   c              3   .   #    U  H  u  pX:H  v   M     g 7fr  ri   ).0r   r   s      re   	<genexpr>STestWriteGraphML.test_write_read_attribute_named_key_ids_graphml.<locals>.<genexpr>       B,A28,A   c              3   .   #    U  H  u  pX:H  v   M     g 7fr  ri   )r%  r$   r%   s      re   r&  r'    r(  r)  )xml.etree.ElementTreer  rP   rD   rE   r  rz   r>   rv   r   rx   r   ry   rQ   r   getrootr   r   r   allr   )r}   r  r   rd   r~   xmlchildrenchildr   default_behavior_fhnamed_key_ids_behavior_fhJs               re   /test_write_read_attribute_named_key_ids_graphml@TestWriteGraphML.test_write_read_attribute_named_key_ids_graphmlt  sR   /..ZZ\A.

OOB

1779aggi00001779aggi00001777-qwwDw/ABBBB'',,Q/Bi&8}!!!+3BQ<8<%<84yA~~"d1g---)T!W444$q')))%a000$q')))%a000 !jjl
0  #OO/0$&JJL!
TJ!&&q)OO56BC,ABBBBBBC,ABBBBB/ 9s   Kc                 .   SSK Jn  U R                  n[        R                  " 5       nU R                  X#SS9  UR                  S5        [        R                  " U5      nUR                  S5        [        UR                  5       UR                  5       5      (       d   e[        UR                  5       UR                  5       5      (       d   e[        UR                  SS9UR                  SS95      (       d   eU R                  R                  S5        U" U5      n[        UR                  5       5      n[!        U5      S:X  d   eUS S  Vs/ s H  owR#                  5       PM     nn[!        U5      S:X  d   eSUS   ;   d   eSUS	   ;   d   eg s  snf )
Nr   r  Tinfer_numeric_typesrt   r"  r   )z	attr.typedoubler;   )r+  r  rS   rD   rE   r  rz   r>   rv   r   rx   r   ry   rT   r   r,  r   r   )	r}   r  r   rd   r~   r.  r/  r0  r   s	            re   .test_write_read_attribute_numeric_type_graphml?TestWriteGraphML.test_write_read_attribute_numeric_type_graphml  sL   /--ZZ\At4

OOB

1779aggi00001779aggi00001777-qwwDw/ABBBB&&++A.Bi&8}!!!+3BQ<8<%<84yA~~&$q'111&$q'111	 9s   Fc                 l   [         R                  " 5       nUR                  SS/5        US-  nU R                  X#5        [         R                  " U5      nUR                  5       (       d   e[        UR                  SS9UR                  SS95      (       d   eUR                  UR                  :X  d   eg)zWriting keys as edge id attributes means keys become strings.
The original keys are stored as data, so read them back in
if `str(key) == edge_id`
This allows the adjacency to remain the same.
r   r   r   )r   r   r"  test.graphmlTr   N)	r>   rZ   rC   r  rv   is_multigraphr   ry   r   r}   tmp_pathr   fnamer~   s        re   test_more_multigraph_keys*TestWriteGraphML.test_more_multigraph_keys  s     MMO	-78>)AOOE"    1777-qwwDw/ABBBBvvrh   c                 z   [         R                  " SS9nUR                  SSSS9  [         R                  " U/ SQ5        UR	                  SSSS	9  S
S0UR
                  S'   SS0UR
                  S'   [        R                  " 5       nU R                  X5        UR                  S5        [         R                  " U[        S9n[        UR                  5       UR                  5       5      (       d   e[        UR                  5       UR                  5       5      (       d   eUR
                  UR
                  :X  d   eg )NFred)namer;   r   )r   r   )r   r;   r   r"  r   r"  r<   r   r   r   r#      edge_defaultr   r   )r>   rV   rA   add_pathrB   rJ   rD   rE   r  rz   rv   r   r   rx   r   ry   r  s       re   test_default_attribute'TestWriteGraphML.test_default_attribute  s    HH&!	

1AW
-
A|$	

1a
"#*H"5#+Q-ZZ\A

OOB#.1779aggi00001779aggi0000ww!''!!!rh   c                    [         R                  " 5       nUR                  SSS9  UR                  SSS9  UR                  SSSS9  UR                  SSSS9  [        R
                  " 5       nU R                  X5        UR                  S5        [         R                  " U5      nUR                  S   S   (       a   eUR                  S   S   S:X  d   eUR                  S   S   (       a   eUR                  S   S   S:X  d   eg )	Nr   Fspecialr   r   rO  r   r   r   r   r   r;   r>   rZ   rA   rB   rD   rE   r  rz   rv   rx   ry   r  s       re   test_mixed_type_attributes+TestWriteGraphML.test_mixed_type_attributes  s    MMO	

4
'	

4
#	

4u
-	

4q
)ZZ\A

OOB774=+++wwt}Y'1,,,77=))444ww}%i0A555rh   c                    [         R                  " 5       nUR                  SSS9  UR                  SSS9  UR                  SSSS9  UR                  SSSS9  [        R
                  " 5       nU R                  X5        UR                  S5        [         R                  " U5      nUR                  S   S   S:X  d   eUR                  S   S   S:X  d   eUR                  S   S   S:X  d   eUR                  S   S   S:X  d   eg )	Nr   hellorN  r   r   rO  rP  rQ  rR  r  s       re   %test_str_number_mixed_type_attributes6TestWriteGraphML.test_str_number_mixed_type_attributes  s    MMO	

4
)	

4
#	

4w
/	

4q
)ZZ\A

OOBwwt}Y'7222wwt}Y'1,,,ww}%i0G;;;ww}%i0A555rh   c                 t   [         R                  " S5      n[        R                  " 5       nUR	                  SUR                  S5      S9  UR	                  SSS9  UR                  SSUR                  S5      S9  UR                  SSSS9  [        R                  " 5       nU R                  X#5        UR                  S5        [        R                  " U5      nUR                  S   S	   S:X  d   eUR                  S   S	   S:X  d   eUR                  S
   S	   S:X  d   eUR                  S   S	   S:X  d   eg )Nnumpyr   r   rN  r   r;   r   r"  rO  rP  rQ  )r   r   r>   rZ   rA   int64rB   rD   rE   r  rz   rv   rx   ry   )r}   npr   rd   r~   s        re   %test_mixed_int_type_number_attributes6TestWriteGraphML.test_mixed_int_type_number_attributes  s     )MMO	

4!
-	

4
#	

4rxx{
3	

4q
)ZZ\A

OOBwwt}Y'1,,,wwt}Y'1,,,ww}%i0A555ww}%i0A555rh   c                 6   [         R                  " 5       nUR                  SS/5        US-  nU R                  X#5        [         R                  " U5      nUR                  5       (       a   e[         R                  " USS9nUR                  5       (       d   eUR                  SSS5        US-  nU R                  X#5        [         R                  " U5      nUR                  5       (       d   e[         R                  " USS9nUR                  5       (       d   eg )	Nr=  )r   cr"  r>  Tr   r   r   ze-id)r>   rZ   rC   r  rv   r?  rB   r@  s        re   test_multigraph_to_graph)TestWriteGraphML.test_multigraph_to_graph  s    MMO	-78>)AOOE"??$$$$OOED9     	


3V$>)AOOE"    OOED9    rh   c                    SSK Jn  [        R                  " 5       nUR	                  / SQ5        UR
                   Vs0 s H  oD[        U5      _M     nn[        R                  " X5S5        US-  nU R                  X6SS9  [        R                  " USS9n[        R                  " U5      n[        UR                  5       UR                  5       5      (       d   e[        UR                  5       UR                  5       5      (       d   e[        R                  " X5S5        [        UR                  SS	9UR                  SS	95      (       d   eU" U5      n	[        U	R                  5       5      n
[!        U
5      S
:X  d   eU	R                  5       R#                  S5       Vs/ s H  nUR$                  S   PM     nn['        U5      ['        UR)                  5       5      :X  d   eSR+                  U5      n[        R,                  " U5      n['        UR                  5       5      ['        UR                  5       5      :X  d   e['        UR                  5       5      ['        UR                  5       5      :X  d   e[        R                  " X5S5        [        UR                  SS	9UR                  SS	95      (       d   eg s  snf s  snf )Nr   r  )r   r   r   r`  r   r`  eidr>  edge_id_from_attributer   Trt   r   ..//{http://graphml.graphdrawing.org/xmlns}edger   )r+  r  r>   rV   rC   ry   r   set_edge_attributesr  generate_graphmlrv   r   rx   r   r   r,  r   findallattribrw   valuesjoinr{   )r}   rA  r  r   eedge_attributesrB  	generatorr~   treer/  edgeedge_idsru   r3  s                  re   *test_write_generate_edge_id_from_attribute;TestWriteGraphML.test_write_generate_edge_id_from_attribute  s;   /HHJ	=>./gg6gc!f9g6
q59>)AU;''%H	OOE"1779aggi00001779aggi0000
q481777-qwwDw/ABBBBU|'8}!!! ..@
 KK 	 
 h6/*@*@*B#CCCC wwy!T"aggi F1779$5555aggi F1779$5555
q481777-qwwDw/ABBBBE 7$
s   J; K c                    SSK Jn  [        R                  " 5       nUR	                  / SQ5        UR
                   Vs0 s H  oD[        U5      _M     nn[        R                  " X5S5        US-  nU R                  X6SS9  [        R                  " USS9n[        R                  " U5      nUR                  5       (       d   e[        R                  " USS9nUR                  5       (       d   e[        UR                  5       UR                  5       5      (       d   e[        UR                  5       UR                  5       5      (       d   e[        S	 UR                  SS
9 5       5      [        UR!                  5       5      :X  d   e[        S UR                  SS9 5       5      [        UR!                  5       5      :X  d   eU" U5      n	[#        U	R%                  5       5      n
['        U
5      S:X  d   eU	R%                  5       R)                  S5       Vs/ s H  nUR*                  S   PM     nn[        U5      [        UR!                  5       5      :X  d   eSR-                  U5      n[        R.                  " U5      nUR                  5       (       d   e[        UR                  5       UR                  5       5      (       d   e[        UR                  5       UR                  5       5      (       d   e[        S UR                  SS
9 5       5      [        UR!                  5       5      :X  d   e[        S UR                  SS9 5       5      [        UR!                  5       5      :X  d   eg s  snf s  snf )Nr   r  )rd  re  rf  rd  rg  r>  rh  Tr   c              3   H   #    U  H  u  po3R                  S 5      v   M     g7frg  Ngetr%  uvru   s       re   r&  YTestWriteGraphML.test_multigraph_write_generate_edge_id_from_attribute.<locals>.<genexpr>X       K8J*!hhuoo8J    "rt   c              3   *   #    U  H	  u  po3v   M     g 7fr  ri   r%  r  r  r   s       re   r&  r  \       >+=iaCc+=   r   r   rj  r   r   c              3   H   #    U  H  u  po3R                  S 5      v   M     g7fr{  r|  r~  s       re   r&  r  s  r  r  c              3   *   #    U  H	  u  po3v   M     g 7fr  ri   r  s       re   r&  r  w  r  r  )r+  r  r>   rZ   rC   ry   r   rk  r  rl  rv   r?  r   rx   r   rw   ro  r   r,  r   rm  rn  rp  r{   )r}   rA  r  r   rq  rr  rB  rs  r~   rt  r/  ru  rv  graphml_datar3  s                  re   5test_multigraph_write_generate_edge_id_from_attributeFTestWriteGraphML.test_multigraph_write_generate_edge_id_from_attributeD  s   /MMO	IJ./gg6gc!f9g6
q59>)AU;''%H	OOE"    OOED9    1779aggi00001779aggi0000KT8JKKv""$P
 
 	
 
 >1777+=>>&""$C
 
 	
 
 U|'8}!!! ..@
 KK 	 
 h6/*@*@*B#CCCC wwy)\*    1779aggi00001779aggi0000KT8JKKv""$P
 
 	
 
 >1777+=>>&""$C
 
 	
 
] 74
s   M/M4c                    [         R                  " S5      nUR                  S5      n[        R                  " SSSU04/5      nUS-  nU R                  XE5        [        R                  " U[        S9nUR                  UR                  :X  d   eUS   S   S   nUS   S   S   nU[         R                  " USS	9:X  d   e[        U5      UR                  :X  d   e[        U5      [        :X  d   eg 
NrZ  g333333@r;   r   r#   r>  r   gư>)abs)r   r   float64r>   rV   r  rv   r   ry   approxtypefloat	r}   rA  r\  wtr   rB  r~   wtGwtHs	            re   test_numpy_float64#TestWriteGraphML.test_numpy_float64{        )ZZ_HHq!h^,-.>)AOOES1ww!''!!!d1ghd1ghfmmCT2222CyBJJ&&&CyE!!!rh   c                    [         R                  " S5      nUR                  S5      n[        R                  " SSSU04/5      nUS-  nU R                  XE5        [        R                  " U[        S9nUR                  UR                  :X  d   eUS   S   S   nUS   S   S   nU[         R                  " USS	9:X  d   e[        U5      UR                  :X  d   e[        U5      [        :X  d   eg r  )r   r   float32r>   rV   r  rv   r   ry   r  r  r  r  s	            re   test_numpy_float32#TestWriteGraphML.test_numpy_float32  r  rh   c                    [         R                  " S5      nU R                  nUR                  S5      UR                  S   S'   US-  nU R                  X4SS9  [        R                  " U5      nUR                  UR                  :X  d   eg )NrZ  r*   )r   r   r#   r>  Tr7  )	r   r   rS   r  ry   r  r>   rv   r   )r}   rA  r\  r   rB  r~   s         re   test_numpy_float64_inference-TestWriteGraphML.test_numpy_float64_inference  sv      )--*,**S/h'>)A$7OOE"vvrh   c                 t   [         R                  " 5       n[        S5      [        S5      -   [        S5      -   n[        S5      [        S5      -   [        S5      -   n[        nUR	                  USUS9  US	-  nU R                  X&5        [         R                  " XeS
9nUR                  UR                  :X  d   eg )Ni(	  {   i  i  i  iD  	Radiohead)r   r>  r   )r>   rV   chrr   rB   r  rv   r   )r}   rA  r   name1name2r   rB  r~   s           re   test_unicode_attributes(TestWriteGraphML.test_unicode_attributes  s    HHJD	CH$s4y0D	CI%C0		

5+5
1>)AOOE7vvrh   c                 Z   SS K nSS0nUR                  U5      n[        R                  " 5       nX4R                  S'   [
        R                  " 5       nU R                  XE5        UR                  S5        [        R                  " U5      nUR                  S   UR                  S   :X  d   eg )Nr   r   z{"a": "123"}r   )
jsondumpsr>   rV   rJ   rD   rE   r  rz   rv   )r}   r  r   sar   rd   r~   s          re   test_unicode_escape$TestWriteGraphML.test_unicode_escape  s    .!ZZ]HHJZZ\A

OOBwwv!''&/111rh   ri   N)rj   rk   rl   rm   staticmethodr>   r  r  rn   rf   r  r  r  r  r4  r:  rC  rK  rS  rW  r]  ra  rw  r  r  r  r  r  r  ro   ri   rh   re   r   r   E  s    "//0F. .<
( (+CZ24 "666 !('CR5
n"" 	 2rh   r   c                   H    \ rS rSr\" \R                  5      r\S 5       r	Sr
g)TestXMLGraphMLi  c                 ,    [         R                  5         g r  )r   rf   )rc   s    re   rf   TestXMLGraphML.setup_class  s    $$&rh   ri   N)rj   rk   rl   rm   r  r>   r  r  rn   rf   ro   ri   rh   re   r  r    s$    "../F' 'rh   r  c                  :   [         R                  " S5        [        R                  " 5       n U R	                  S/ SQS9  [
        R                  " 5       n[         R                  " [        SS9   [        R                  " X5        SSS5        g! , (       d  f       g= f)mTest that a detailed exception is raised when an attribute is of a type
not supported by GraphML, e.g. a listr   r   r   r;   r   my_list_attributeGraphML does not supportmatchN)
r   r   r>   rV   rA   rD   rE   r   	TypeErrorr   r   rd   s     re   1test_exception_for_unsupported_datatype_node_attrr    sb     %

AJJqIJ.	B	y(B	C
 
D	C	Cs   ,B
Bc                  <   [         R                  " S5        [        R                  " 5       n U R	                  SS/ SQS9  [
        R                  " 5       n[         R                  " [        SS9   [        R                  " X5        SSS5        g! , (       d  f       g= f)	r  r   r   r;   r  r  r  r  N)
r   r   r>   rV   rB   rD   rE   r   r  r   r  s     re   1test_exception_for_unsupported_datatype_edge_attrr    sd     %

AJJq!yJ1	B	y(B	C
 
D	C	Cs   -B
Bc                  8   [         R                  " S5        [        R                  " 5       n / SQU R                  S'   [
        R                  " 5       n[         R                  " [        SS9   [        R                  " X5        SSS5        g! , (       d  f       g= f)r  r   r  r  r  r  N)
r   r   r>   rV   rJ   rD   rE   r   r  r   r  s     re   2test_exception_for_unsupported_datatype_graph_attrr    sa     %

A#,AGG 	B	y(B	C
 
D	C	Cs   +B
Bc                      Sn [         R                  " U R                  S5      5      n[        R                  " U5      nUR
                  S   SSS.:X  d   eUR
                  S   SS	S.:X  d   eg
)zLTests that a GraphML string with an empty attribute can be parsed
correctly.a  <?xml version='1.0' encoding='utf-8'?>
    <graphml>
      <key id="d1" for="node" attr.name="foo" attr.type="string"/>
      <key id="d2" for="node" attr.name="bar" attr.type="string"/>
      <graph>
        <node id="0">
          <data key="d1">aaa</data>
          <data key="d2">bbb</data>
        </node>
        <node id="1">
          <data key="d1">ccc</data>
          <data key="d2"></data>
        </node>
      </graph>
    </graphml>r   r2   aaabbb)r   barr7   cccr   N)rD   rE   rF   r>   rv   rx   )r   rd   r   s      re   test_empty_attributer    sf    	A 
AHHW%	&B
A773<57777773<54444rh   )rD   r   networkxr>   networkx.readwrite.graphmlr   networkx.utilsr   r   r   rq   r   r  r  r  r  r  ri   rh   re   <module>r     s`    	   4 3l7 l7^	I6k I6Xr2{ r2j'% '	 	 	 5rh   