
    \Mh                        d dl Z d dlZd dlZd dlmZ d dlmZmZ  G d d          Z	 G d de	          Z
 G d d	e	          Z G d
 de          Zd Zd Zd Zd ZdS )    N)GraphMLWriter)edges_equalnodes_equalc                   $    e Zd Zed             ZdS )BaseGraphMLc                    d| _         t          j                    | _        | j                            d           | j                            ddd           | j                            dd           | j                            g d           t          j        | j         	                    d                    | _
        d	| _        t          j        d
          | _        ddi| j        j        d<   | j                            dd           | j                            dd           | j                            dd           | j                            d           | j                            dd           | j                            dddd           | j                            dddd           | j                            dddd           | j                            ddd           | j                            ddd           | j                            ddd           | j                            ddd d!           t          j        | j        	                    d                    | _        d"| _        t          j        d
          | _        d#d$d$d%d%d&d'| j        j        d<   | j                            d           | j                            d           | j                            ddd           t          j        | j        	                    d                    | _        d(| _        t          j                    | _        | j                            d)d*d+,           | j                            d-d.d+,           | j                            d)d-d/0           t          j        | j        	                    d                    }|| _        d1| _        t          j                    | _        | j                            dd23           | j                            dd3           | j                            ddd23           | j                            ddd3           t          j        | j        	                    d                    }|| _        d4| _        t          j                    | _        | j                            d           | j                            ddd           | j                            d5d6g           t          j        | j        	                    d                    }|| _        d7| _        t          j                    | _        | j                            d           | j                            ddd           | j                            ddd           | j                            ddd           t          j        | j        	                    d                    }|| _        d8| _         t          j                    | _!        | j!                            d           | j!                            ddd           | j!                            ddd           | j!                            ddd           t          j        | j         	                    d                    }|| _"        d9| _#        t          j                    | _$        | j$                            d           | j$                            dd           | j$                            ddd           | j$                            ddd           t          j        | j#        	                    d                    }|| _%        d S ):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     e/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/networkx/readwrite/tests/test_graphml.pysetup_classzBaseGraphML.setup_class   s5   $ > %'JLL!!**5111!**4%*@@@!**4666!00  	
 	
 	
 "$C,D,K,KG,T,T!U!U)T !jC0005<h4G!.1$$T$999$$T$888$$T$777$$T***$$T$===$$T4D$EEE$$T4D$EEE$$T4D$EEE$$T4D$999$$T4D$999$$T4D$999$$T4D$EEE:c&8&?&?&H&HII+'$ ,.:+=+=+=(!&" # %B
 B
(.~> 	(11$777(11$777(11$1FFF(*
+227;;)
 )
%,(. -/JLL))223fF2SSS)223iv2VVV)223|2TTTZ8??HHII)+&+'4 ,.:<<((11$q1AAA(11$s1CCC(11$Q1GGG(11$S1IIIZ7>>wGGHH(*%&"  ')hjj##,,U333#,,T4E,BBB#22L,3OPPPZ299'BBCC#% *& %'MOO!!**5111!**4$*???!**4$*???!**4$*???Z6==gFFGG')$73 24..77>>>.77dt7LLL.77dt7LLL.77dt7LLLZCJJ7SSTT46173 24..77>>>.77dCCC.77dt7LLL.77dt7LLLZCJJ7SSTT46111    N)__name__
__module____qualname__classmethodrf    rg   re   r   r   
   s2        j7 j7 [j7 j7 j7rg   r   c                   z    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd ZdS )TestReadGraphMLc                    | j         }t          j        | j                  }t	          |                                          t	          |                                          k    sJ t	          |                                          t	          |                                          k    sJ t	          |                    d                    t	          |                    d                    k    sJ | j                            d           t          j        | j	                  }t	          |                                          t	          |                                          k    sJ t	          |                                          t	          |                                          k    sJ t	          |                    d                    t	          |                    d                    k    sJ d S NTdatar   )
r@   r>   read_graphmlrG   sortednodesedgesseekparse_graphmlr=   selfr   HPGs       re   !test_read_simple_directed_graphmlz1TestReadGraphML.test_read_simple_directed_graphml:  s   &OD344aggii  F17799$5$55555aggii  F17799$5$55555agg4g(())VAGGG4F4F-G-GGGGG$$Q'''d788aggii  F288::$6$66666aggii  F288::$6$66666agg4g(())VBHH$H4G4G-H-HHHHHHHrg   c                 \   | j         }t          j        | j                  }t	          |                                |                                          sJ t          |                                |                                          sJ | j                            d           t          j	        | j
                  }t	          |                                |                                          sJ t          |                                |                                          sJ d S Nr   )rW   r>   rs   rX   r   ru   r   rv   rw   rx   rU   ry   s       re   #test_read_simple_undirected_graphmlz3TestReadGraphML.test_read_simple_undirected_graphmlG  s    (OD56617799aggii0000017799aggii00000!&&q)))d9::17799bhhjj1111117799bhhjj1111111rg   c                 \   | j         }t          j        | j                  }t	          |                                |                                          sJ t          |                                |                                          sJ | j                            d           t          j	        | j
                  }t	          |                                |                                          sJ t          |                                |                                          sJ d S r   )r[   r>   rs   r\   r   ru   r   rv   rw   rx   rY   ry   s       re   'test_read_undirected_multigraph_graphmlz7TestReadGraphML.test_read_undirected_multigraph_graphmlR  s    &OD9::17799aggii0000017799aggii00000%**1---d=>>17799bhhjj1111117799bhhjj1111111rg   c                 \   | j         }t          j        | j                  }t	          |                                |                                          sJ t          |                                |                                          sJ | j                            d           t          j	        | j
                  }t	          |                                |                                          sJ t          |                                |                                          sJ d S r   )r^   r>   rs   r_   r   ru   r   rv   rw   rx   r]   ry   s       re   4test_read_undirected_multigraph_no_multiedge_graphmlzDTestReadGraphML.test_read_undirected_multigraph_no_multiedge_graphml]      3ODFGG17799aggii0000017799aggii00000277:::dJKK17799bhhjj1111117799bhhjj1111111rg   c                 \   | j         }t          j        | j                  }t	          |                                |                                          sJ t          |                                |                                          sJ | j                            d           t          j	        | j
                  }t	          |                                |                                          sJ t          |                                |                                          sJ d S r   )ra   r>   rs   rb   r   ru   r   rv   rw   rx   r`   ry   s       re   ?test_read_undirected_multigraph_only_ids_for_multiedges_graphmlzOTestReadGraphML.test_read_undirected_multigraph_only_ids_for_multiedges_graphmlh  r   rg   c                 Z   | j         }t          j        | j                  }t	          |                    d          t          |                    d                              sJ t          |                    d                    }t          |                    d                    }t          ||          D ]\  }}||k    sJ | j        	                    d           t          j
        | j                  }t          |                    d                    t          |                    d                    k    sJ t          |                    d                    }t          |                    d                    }t          ||          D ]\  }}||k    sJ d S rp   )rI   r>   rs   rK   r   ru   rt   rv   ziprw   rx   rH   )rz   r   r{   geheabr|   s           re   test_read_attribute_graphmlz+TestReadGraphML.test_read_attribute_graphmls  s    OD-..1774==&d1C1C*D*DEEEEEAGGG&&''AGGG&&''BKK 	 	DAq66666q!!!d122aggdmm$$rxxTx/B/B(C(CCCCCAGGG&&''BHH$H''((BKK 	 	DAq66666	 	rg   c                     | j         }t          j        | j                  }|j        d         |j        d         k    sJ d S )Nr   )rM   r>   rs   rN   rJ   )rz   r   r{   s      re   #test_node_default_attribute_graphmlz3TestReadGraphML.test_node_default_attribute_graphml  sA    -OD:;;w~&!'.*AAAAAAArg   c                     d}t          j        |                    d                    }t          j        t
          j        t
          j        |           t          j        t
          j        t
          j        |           d S )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>   NetworkXErrorrs   rx   rz   srd   s      re    test_directed_edge_in_undirectedz0TestReadGraphML.test_directed_edge_in_undirected  _     Z))**b&<<<b&(8!<<<<<rg   c                     d}t          j        |                    d                    }t          j        t
          j        t
          j        |           t          j        t
          j        t
          j        |           d S )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_directedz0TestReadGraphML.test_undirected_edge_in_directed  r   rg   c                     d}t          j        |                    d                    }t          j        t
          j        t
          j        |           t          j        t
          j        t
          j        |           d S )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_raisezTestReadGraphML.test_key_raise  s_    . Z))**b&<<<b&(8!<<<<<rg   c                     d}t          j        |                    d                    }t          j        t
          j        t
          j        |           t          j        t
          j        t
          j        |           d S )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_raisez$TestReadGraphML.test_hyperedge_raise  s_    2 Z))**b&<<<b&(8!<<<<<rg   c                 ~   d}t          j        |                    d                    }t          j        |          }ddg}t          |                    d                    |k    sJ |                    d           t          j        |          }t          |                    d                    |k    sJ d S )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>   rs   rt   rv   rw   rx   rz   r   rd   r   expectedr{   s         re   test_multigraph_keysz$TestReadGraphML.test_multigraph_keys  s     Z))**OB&(:;agg4g(())X5555



Qagg4g(())X555555rg   c                    t          j                    }|                    d           |                    d           |                    dddddifddddifdddd	d
fdddddifdddddifdddddd
fg           t	          j                    }t          j        ||           |                    d           t          j        |t                    }t          |                    dd          |                    dd                    sJ |j        |j        k    sJ d |j                                        D             }|                    d           t          j        |t          t                    }||j        k    sJ |                    d           |                                }t          j        |t          t                    }||j        k    sJ dS )zf
        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)rr   r   c                 l    i | ]1\  }}t          |          d  |                                D             2S )c                 l    i | ]1\  }}t          |          d  |                                D             2S )c                 4    i | ]\  }}t          |          |S rl   str).0ekeydds      re   
<dictcomp>zWTestReadGraphML.test_preserve_multi_edge_data.<locals>.<dictcomp>.<dictcomp>.<dictcomp>  s$    JJJXT23t99bJJJrg   r   items)r   nbrkey_dicts      re   r   zLTestReadGraphML.test_preserve_multi_edge_data.<locals>.<dictcomp>.<dictcomp>  sM       !C CJJ9I9IJJJ  rg   r   )r   nodenbr_dicts      re   r   zATestReadGraphML.test_preserve_multi_edge_data.<locals>.<dictcomp>  sZ     
 
 

 h	 II  %-^^%5%5  
 
 
rg   )r   edge_key_typeN)r>   rZ   rA   rC   rD   rE   write_graphmlrw   rs   intr   rv   _adjr   r   readrx   )rz   r   rd   r{   GadjHH	string_fhs          re   test_preserve_multi_edge_dataz-TestReadGraphML.test_preserve_multi_edge_data  s   
 MOO	

1	

1	 A{+,Aj)*A{*==>AsUK01AsT:./AsKzBBC	
 	
 	
 Z\\
B



OB#...1774788!''tRV':W:WXXXXXv
 

 #$&,,..
 
 
 	


_R3cBBBrw



GGII	i3cJJJrwrg   c                 "   d}t          j        |                    d                    }t          j        |d          }t          |                                          dgk    sJ |                    ddd	          sJ |j        d         d
         dk    sJ |j        d         d
         dk    sJ |j        d         d
         dk    sJ |j        d         d         dk    sJ |j        d         d         dk    sJ |j        d         d         dk    sJ |j        d         d         dk    sJ |	                    d           t          j        |          }t          |                                          dgk    sJ |d         d         d         dk    sJ |j        d         d
         dk    sJ |j        d         d
         dk    sJ |j        d         d
         dk    sJ |j        d         d         dk    sJ |j        d         d         dk    sJ |j        d         d         dk    sJ |j        d         d         dk    sJ t          j
        |d          }t          |                                          dgk    sJ |                    ddd	          sJ |j        d         d
         dk    sJ |j        d         d
         dk    sJ |j        d         d
         dk    sJ t          j
        |          }t          |                                          dgk    sJ |d         d         d         dk    sJ |j        d         d
         dk    sJ |j        d         d
         dk    sJ |j        d         d
         dk    sJ d S )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>   rs   listrv   has_edgeru   rw   rx   )rz   rr   rd   r   r{   s        re   test_yfiles_extensionz%TestReadGraphML.test_yfiles_extension+  s   Yt ZG,,--OB666AGGII<.0000zz$$z/////wt}W%,,,,wt}W%,,,,wt}W%,,,,wt}\*k9999wt}\*k9999wt}\*.OOOOOwt}]+/JJJJJ



OBAGGII<.0000wt}T"d****wt}W%,,,,wt}W%,,,,wt}W%,,,,wt}\*k9999wt}\*k9999wt}\*.OOOOOwt}]+/JJJJJTD999AGGII<.0000zz$$z/////wt}W%,,,,wt}W%,,,,wt}W%,,,,T""AGGII<.0000wt}T"d****wt}W%,,,,wt}W%,,,,wt}W%,,,,,,rg   c                    d}t          j        |                    d                    }t          j        |          }t          j        |          }||fD ]}|j        d         d         sJ |j        d         d         rJ |j        d         d         rJ |j        d         d         sJ |j        d         d         rJ |j        d	         d         sJ d S )
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>   rs   rx   ru   )rz   r   rd   r   r{   rJ   s         re   	test_boolzTestReadGraphML.test_bool  s    > Z))**OBQV 	- 	-E;t$V,,,,{4(0000{4(0000;t$V,,,,{4(0000;t$V,,,,,	- 	-rg   c                    d}d}d}||fD ]m}t          j        |                    d                    }t          j        |          }t          j        |          }||fD ]}|j        d         d         sJ nt          j        |                    d                    }t          j        t          j	        t          j        |           t          j        t          j	        t          j        |           d S )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>   rs   rx   ru   r   r   r   )	rz   goodbaduglyr   rd   r   r{   rJ   s	            re   test_graphml_header_linez(TestReadGraphML.test_graphml_header_line  s      	1 	1AAHHW--..B##A ##AQ 1 1{4(000001 ZG,,--b&<<<b&(8$?????rg   c                    d}t          j        |                    d                    }t          j        |          }d |                    d          D             }t          |          dk    sJ |D ]}|d         dk    sJ d S )	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   c                     g | ]\  }}|S rl   rl   )r   _xs      re   
<listcomp>zDTestReadGraphML.test_read_attributes_with_groups.<locals>.<listcomp>(  s    111da111rg   Trq   	   CustomProperty )rD   rE   rF   r>   rs   ru   len)rz   rr   rd   r   	node_datas        re    test_read_attributes_with_groupsz0TestReadGraphML.test_read_attributes_with_groups	  s    Zx ZG,,--OB11agg4g001114yyA~~~~ 	5 	5I-."44444	5 	5rg   c                    d}t          j        |                    d                    }t          j        |          }dddifg}t          |                    d                    |k    sJ |                    d           t          j        |          }t          |                    d                    |k    sJ d S )	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  Trq   r   )	rD   rE   rF   r>   rs   rt   ru   rw   rx   r   s         re   test_long_attribute_typez(TestReadGraphML.test_long_attribute_type-  s     Z))**OBM4012agg4g(())X5555



Qagg4g(())X555555rg   N)rh   ri   rj   r}   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rl   rg   re   rn   rn   9  s6       I I I	2 	2 	2	2 	2 	2	2 	2 	2	2 	2 	2  "B B B
= = =$= = =$= = =8= = =<6 6 6.+ + +Z~- ~- ~-@)- )- )-V1@ 1@ 1@fb5 b5 b5H	6 6 6 6 6rg   rn   c                       e Zd Z eej                  Zed             Zd Z	d Z
d Zd Zd Zd Zd Zd	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd ZdS )TestWriteGraphMLc                 `    t                                            t          j        d          }d S )N
lxml.etree)r   rf   r   importorskip)rc   r   s     re   rf   zTestWriteGraphML.setup_classH  s(    !!!--rg   c                     	 dd l }t          j        t          j        k    sJ d S # t          $ r  t          j        t          j        k    sJ Y d S w xY wr   )
lxml.etreer>   r   write_graphml_lxmlImportErrorwrite_graphml_xml)rz   lxmls     re   test_write_interfacez%TestWriteGraphML.test_write_interfaceM  sk    	<#r'<<<<<<< 	< 	< 	<#r';;;;;;;;	<s    $ &AAc                    | j         }d|j        d<   t          j                    }|                     ||           |                    d           t          j        |          }t          |	                                          t          |	                                          k    sJ t          |
                                          t          |
                                          k    sJ t          |
                    d                    t          |
                    d                    k    sJ | j                            d           d S )Ntherehir   Trq   r@   rJ   rD   rE   writerrw   r>   rs   rt   ru   rv   rG   rz   r   rd   r{   s       re   'test_write_read_simple_directed_graphmlz8TestWriteGraphML.test_write_read_simple_directed_graphmlU  s   &Z\\Ar



OBaggii  F17799$5$55555aggii  F17799$5$55555agg4g(())VAGGG4F4F-G-GGGGG$$Q'''''rg   c                     t                      }| j        }|                                }|                    ||g           d S N)r   r@   copy
add_graphs)rz   gmlwr   r{   s       re   test_GraphMLWriter_add_graphsz.TestWriteGraphML.test_GraphMLWriter_add_graphsa  s<    &FFHHArg   c                    | j         }d|j        d<   d|j        d<   t          j                    }|                     ||d           |                    d           t          j        |          }t          |	                                          t          |	                                          k    sJ t          |
                                          t          |
                                          k    sJ t          |
                    d	                    t          |
                    d	                    k    sJ | j                            d           d S )
Nr   r   r7   r   F)prettyprintr   Trq   r   r  s       re   %test_write_read_simple_no_prettyprintz6TestWriteGraphML.test_write_read_simple_no_prettyprintg  s   &Z\\Aru---



OBaggii  F17799$5$55555aggii  F17799$5$55555agg4g(())VAGGG4F4F-G-GGGGG$$Q'''''rg   c                    ddl m} | j        }t          j                    }|                     ||d           |                    d           t          j        |          }|                    d           t          |
                                |
                                          sJ t          |                                |                                          sJ t          |                    d          |                    d                    sJ | j                            d            ||          }t          |                                          }t!          |          dk    sJ d |d d         D             }t!          |          dk    sJ d	|d         v sJ d
|d         v sJ d|d         v sJ d|d         v sJ d|d         v sJ d|d         v sJ t          j                    }t          j        ||           |                    d           t          j        |          }t          j                    }	t          j        ||	d           |	                    d           t          j        |	          }
t%          d t'          |j
        |
j
                  D                       sJ t%          d t'          |j        |
j                  D                       sJ d S )Nr   parseT)named_key_idsrq      c                 6    g | ]}|                                 S rl   r   r   childs     re   r   zTTestWriteGraphML.test_write_read_attribute_named_key_ids_graphml.<locals>.<listcomp>       888%888rg      )r   r:   )	attr.namer:   )r   r6   r;   )r  r6   )r   r5   r   )r  r5   c              3   (   K   | ]\  }}||k    V  d S r  rl   )r   r   r   s      re   	<genexpr>zSTestWriteGraphML.test_write_read_attribute_named_key_ids_graphml.<locals>.<genexpr>  *      BBR28BBBBBBrg   c              3   (   K   | ]\  }}||k    V  d S r  rl   )r   r$   r%   s      re   r  zSTestWriteGraphML.test_write_read_attribute_named_key_ids_graphml.<locals>.<genexpr>  r  rg   )xml.etree.ElementTreer  rP   rD   rE   r   rw   r>   rs   r   ru   r   rv   rQ   r   getrootr   r   allr   )rz   r  r   rd   r{   xmlchildrenr   default_behavior_fhnamed_key_ids_behavior_fhJs              re   /test_write_read_attribute_named_key_ids_graphmlz@TestWriteGraphML.test_write_read_attribute_named_key_ids_graphmlt  s   //////.Z\\Ar...



OB



17799aggii0000017799aggii000001777--qwwDw/A/ABBBBB',,Q///eBii&&8}}!!!!888BQB<8884yyA~~~~"d1g----)T!W4444$q'))))%a0000$q'))))%a0000 !jll
/000  ###O/00$&JLL!
5TJJJJ!&&q)))O566BBC,A,ABBBBBBBBBBC,A,ABBBBBBBBBBrg   c                 v   ddl m} | j        }t          j                    }|                     ||d           |                    d           t          j        |          }|                    d           t          |
                                |
                                          sJ t          |                                |                                          sJ t          |                    d          |                    d                    sJ | j                            d            ||          }t          |                                          }t!          |          dk    sJ d |d d         D             }t!          |          dk    sJ d	|d         v sJ d	|d
         v sJ d S )Nr   r  Tinfer_numeric_typesrq   r  c                 6    g | ]}|                                 S rl   r  r  s     re   r   zSTestWriteGraphML.test_write_read_attribute_numeric_type_graphml.<locals>.<listcomp>  r  rg   r   )z	attr.typedoubler;   )r  r  rS   rD   rE   r   rw   r>   rs   r   ru   r   rv   rT   r   r  r   )rz   r  r   rd   r{   r  r   r   s           re   .test_write_read_attribute_numeric_type_graphmlz?TestWriteGraphML.test_write_read_attribute_numeric_type_graphml  s   //////-Z\\Art444



OB



17799aggii0000017799aggii000001777--qwwDw/A/ABBBBB&++A...eBii&&8}}!!!!888BQB<8884yyA~~~~&$q'1111&$q'111111rg   c                 |   t          j                    }|                    ddg           |dz  }|                     ||           t          j        |          }|                                sJ t          |                    d          |                    d                    sJ |j        |j        k    sJ dS )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   rs   is_multigraphr   rv   r   rz   tmp_pathr   fnamer{   s        re   test_more_multigraph_keysz*TestWriteGraphML.test_more_multigraph_keys  s     MOO	-7888>)AuOE""     1777--qwwDw/A/ABBBBBvrg   c                    t          j        d          }|                    ddd           t          j        |g d           |                    ddd	           d
di|j        d<   ddi|j        d<   t          j                    }|                     ||           |	                    d           t          j
        |t                    }t          |                                |                                          sJ t          |                                |                                          sJ |j        |j        k    sJ d S )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   rw   rs   r   r   ru   r   rv   r  s       re   test_default_attributez'TestWriteGraphML.test_default_attribute  s$   H&!!!	

1AW
---
A|||$$$	

1a
"""#*H"5#+Q-Z\\Ar



OB#...17799aggii0000017799aggii00000w!'!!!!!!rg   c                 D   t          j                    }|                    dd           |                    dd           |                    ddd           |                    ddd           t	          j                    }|                     ||           |                    d           t          j        |          }|j	        d         d         rJ |j	        d         d         dk    sJ |j
        d         d         rJ |j
        d         d         dk    sJ d S )	Nr
   Fspecialr   r   r<  r
   r   r   r
   r   r;   r>   rZ   rA   rB   rD   rE   r   rw   rs   ru   rv   r  s       re   test_mixed_type_attributesz+TestWriteGraphML.test_mixed_type_attributes  s   MOO	

4
'''	

4
###	

4u
---	

4q
)))Z\\Ar



OB74=++++wt}Y'1,,,,7=))4444w}%i0A555555rg   c                 T   t          j                    }|                    dd           |                    dd           |                    ddd           |                    ddd           t	          j                    }|                     ||           |                    d           t          j        |          }|j	        d         d         dk    sJ |j	        d         d         dk    sJ |j
        d         d         dk    sJ |j
        d         d         dk    sJ d S )	Nr
   hellor;  r   r   r<  r=  r>  r?  r  s       re   %test_str_number_mixed_type_attributesz6TestWriteGraphML.test_str_number_mixed_type_attributes  s   MOO	

4
)))	

4
###	

4w
///	

4q
)))Z\\Ar



OBwt}Y'72222wt}Y'1,,,,w}%i0G;;;;w}%i0A555555rg   c                    t          j        d          }t          j                    }|                    d|                    d                     |                    dd           |                    dd|                    d                     |                    ddd           t          j                    }| 	                    ||           |
                    d           t          j        |          }|j        d         d	         dk    sJ |j        d         d	         dk    sJ |j        d
         d	         dk    sJ |j        d         d	         dk    sJ d S )Nnumpyr
   r   r;  r   r;   r   r  r<  r=  r>  )r   r   r>   rZ   rA   int64rB   rD   rE   r   rw   rs   ru   rv   )rz   npr   rd   r{   s        re   %test_mixed_int_type_number_attributesz6TestWriteGraphML.test_mixed_int_type_number_attributes  sB    ))MOO	

4!
---	

4
###	

4rxx{{
333	

4q
)))Z\\Ar



OBwt}Y'1,,,,wt}Y'1,,,,w}%i0A5555w}%i0A555555rg   c                 L   t          j                    }|                    ddg           |dz  }|                     ||           t          j        |          }|                                rJ t          j        |d          }|                                sJ |                    ddd           |dz  }|                     ||           t          j        |          }|                                sJ t          j        |d          }|                                sJ d S )	Nr,  )r   cr  r-  Tr   r   r   ze-id)r>   rZ   rC   r   rs   r.  rB   r/  s        re   test_multigraph_to_graphz)TestWriteGraphML.test_multigraph_to_graph  s   MOO	-7888>)AuOE""??$$$$$OED999      	


3V$$$>)AuOE""     OED999       rg   c                    ddl m} t          j                    }|                    g d           d |j        D             }t          j        ||d           |dz  }|                     ||d           t          j        |d          }t          j	        |          }t          |                                |                                          sJ t          |                                |                                          sJ t          j        ||d           t          |                    d	
          |                    d	
                    sJ  ||          }t          |                                          }	t          |	          dk    sJ d |                                                    d          D             }
t#          |
          t#          |                                          k    sJ d                    |          }t          j        |          }t#          |                                          t#          |                                          k    sJ t#          |                                          t#          |                                          k    sJ t          j        ||d           t          |                    d	
          |                    d	
                    sJ d S )Nr   r  )r   r   r   rJ  r   rJ  c                 .    i | ]}|t          |          S rl   r   r   es     re   r   zOTestWriteGraphML.test_write_generate_edge_id_from_attribute.<locals>.<dictcomp>        6661c!ff666rg   eidr-  edge_id_from_attributer   Trq   r   c                 (    g | ]}|j         d          S r   attribr   edges     re   r   zOTestWriteGraphML.test_write_generate_edge_id_from_attribute.<locals>.<listcomp>2  /     
 
 
 K
 
 
rg   ..//{http://graphml.graphdrawing.org/xmlns}edger   )r  r  r>   rV   rC   rv   set_edge_attributesr   generate_graphmlrs   r   ru   r   r   r  r   findallrt   valuesjoinrx   )rz   r0  r  r   edge_attributesr1  	generatorr{   treer   edge_idsrr   r#  s                re   *test_write_generate_edge_id_from_attributez;TestWriteGraphML.test_write_generate_edge_id_from_attribute  s   //////HJJ	===>>>66ag666
q/5999>)AuU;;;'%HHH	OE""17799aggii0000017799aggii00000
q/48881777--qwwDw/A/ABBBBBuU||''8}}!!!!
 
..@ 
 
 
 h6/*@*@*B*B#C#CCCCC wwy!!T""aggii  F17799$5$55555aggii  F17799$5$55555
q/48881777--qwwDw/A/ABBBBBBBrg   c                    ddl m} t          j                    }|                    g d           d |j        D             }t          j        ||d           |dz  }|                     ||d           t          j        |d          }t          j	        |          }|
                                sJ t          j	        |d	          }|
                                sJ t          |                                |                                          sJ t          |                                |                                          sJ t          d
 |                    d          D                       t          |                                          k    sJ t          d |                    d          D                       t          |                                          k    sJ  ||          }t!          |                                          }	t%          |	          dk    sJ d |                                                    d          D             }
t          |
          t          |                                          k    sJ d                    |          }t          j        |          }|
                                sJ t          |                                |                                          sJ t          |                                |                                          sJ t          d |                    d          D                       t          |                                          k    sJ t          d |                    d          D                       t          |                                          k    sJ d S )Nr   r  )rM  rN  rO  rM  c                 .    i | ]}|t          |          S rl   r   rQ  s     re   r   zZTestWriteGraphML.test_multigraph_write_generate_edge_id_from_attribute.<locals>.<dictcomp>I  rS  rg   rT  r-  rU  Tr   c              3   H   K   | ]\  }}}|                     d           V  dS rT  Ngetr   uvrr   s       re   r  zYTestWriteGraphML.test_multigraph_write_generate_edge_id_from_attribute.<locals>.<genexpr>X  2      KK*!QdhhuooKKKKKKrg   rq   c              3   "   K   | ]
\  }}}|V  d S r  rl   r   ro  rp  r   s       re   r  zYTestWriteGraphML.test_multigraph_write_generate_edge_id_from_attribute.<locals>.<genexpr>\  (      >>iaCc>>>>>>rg   r   r   c                 (    g | ]}|j         d          S r   rX  rZ  s     re   r   zZTestWriteGraphML.test_multigraph_write_generate_edge_id_from_attribute.<locals>.<listcomp>c  r\  rg   r]  r   c              3   H   K   | ]\  }}}|                     d           V  dS rk  rl  rn  s       re   r  zYTestWriteGraphML.test_multigraph_write_generate_edge_id_from_attribute.<locals>.<genexpr>s  rq  rg   c              3   "   K   | ]
\  }}}|V  d S r  rl   rs  s       re   r  zYTestWriteGraphML.test_multigraph_write_generate_edge_id_from_attribute.<locals>.<genexpr>w  rt  rg   )r  r  r>   rZ   rC   rv   r^  r   r_  rs   r.  r   ru   r   rt   ra  r   r  r   r`  rb  rx   )rz   r0  r  r   rc  r1  rd  r{   re  r   rf  graphml_datar#  s                re   5test_multigraph_write_generate_edge_id_from_attributezFTestWriteGraphML.test_multigraph_write_generate_edge_id_from_attributeD  s   //////MOO	IIIJJJ66ag666
q/5999>)AuU;;;'%HHH	OE""     OED999     17799aggii0000017799aggii00000KKT8J8JKKKKKv""$$P
 P
 
 
 
 
 >>1777+=+=>>>>>&""$$C
 C
 
 
 
 
 uU||''8}}!!!!
 
..@ 
 
 
 h6/*@*@*B*B#C#CCCCC wwy))\**     17799aggii0000017799aggii00000KKT8J8JKKKKKv""$$P
 P
 
 
 
 
 >>1777+=+=>>>>>&""$$C
 C
 
 
 
 
 
 
rg   c                    t          j        d          }|                    d          }t          j        ddd|ifg          }|dz  }|                     ||           t          j        |t                    }|j        |j        k    sJ |d         d         d         }|d         d         d         }|t          j	        |d	          k    sJ t          |          |j        u sJ t          |          t          u sJ d S 
NrE  g333333@r;   r   r#   r-  r   gư>)abs)r   r   float64r>   rV   r   rs   r   rv   approxtypefloat	rz   r0  rG  wtr   r1  r{   wtGwtHs	            re   test_numpy_float64z#TestWriteGraphML.test_numpy_float64{       ))ZZ__Hq!h^,-..>)AuOES111w!'!!!!d1ghd1ghfmCT2222222CyyBJ&&&&CyyE!!!!!!rg   c                    t          j        d          }|                    d          }t          j        ddd|ifg          }|dz  }|                     ||           t          j        |t                    }|j        |j        k    sJ |d         d         d         }|d         d         d         }|t          j	        |d	          k    sJ t          |          |j        u sJ t          |          t          u sJ d S r{  )r   r   float32r>   rV   r   rs   r   rv   r~  r  r  r  s	            re   test_numpy_float32z#TestWriteGraphML.test_numpy_float32  r  rg   c                    t          j        d          }| j        }|                    d          |j        d         d<   |dz  }|                     ||d           t          j        |          }|j        |j        k    sJ d S )NrE  r*   )r   r   r#   r-  Tr&  )	r   r   rS   r}  rv   r   r>   rs   r   )rz   r0  rG  r   r1  r{   s         re   test_numpy_float64_inferencez-TestWriteGraphML.test_numpy_float64_inference  s     ))-*,**S//h'>)Au$777OE""vrg   c                    t          j                    }t          d          t          d          z   t          d          z   }t          d          t          d          z   t          d          z   }t          }|                    |d|           |d	z  }|                     ||           t          j        ||
          }|j        |j        k    sJ d S )Ni(	  {   i  i  i  iD  	Radiohead)r   r-  r   )r>   rV   chrr   rB   r   rs   r   )rz   r0  r   name1name2r   r1  r{   s           re   test_unicode_attributesz(TestWriteGraphML.test_unicode_attributes  s    HJJD		CHH$s4yy0D		CII%C0		

5+5
111>)AuOEY777vrg   c                 Z   dd l }ddi}|                    |          }t          j                    }||j        d<   t          j                    }|                     ||           |                    d           t          j	        |          }|j        d         |j        d         k    sJ d S )Nr   r   z{"a": "123"}r   )
jsondumpsr>   rV   rJ   rD   rE   r   rw   rs   )rz   r  r   sar   rd   r{   s          re   test_unicode_escapez$TestWriteGraphML.test_unicode_escape  s    .!ZZ]]HJJZ\\Ar



OBwv!'&/111111rg   N)rh   ri   rj   staticmethodr>   r   r   rk   rf   r   r  r  r  r$  r*  r2  r9  r@  rC  rH  rK  rg  ry  r  r  r  r  r  rl   rg   re   r   r   E  se       \"/00F. . [.< < <
( 
( 
(     ( ( (+C +C +CZ2 2 24     " " "6 6 66 6 66 6 6 ! ! !('C 'C 'CR5
 5
 5
n" " "" " "     	  	  	 2 2 2 2 2rg   r   c                   D    e Zd Z eej                  Zed             ZdS )TestXMLGraphMLc                 8    t                                            d S r  )r   rf   )rc   s    re   rf   zTestXMLGraphML.setup_class  s    $$&&&&&rg   N)	rh   ri   rj   r  r>   r   r   rk   rf   rl   rg   re   r  r    s?        \".//F' ' [' ' 'rg   r  c                  >   t          j        d           t          j                    } |                     dg d           t          j                    }t          j        t          d          5  t          j	        | |           ddd           dS # 1 swxY w Y   dS )qTest 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    s     %%%


AJJqIIIJ...	B	y(B	C	C	C    
B                                   s   /BBBc                  @   t          j        d           t          j                    } |                     ddg d           t          j                    }t          j        t          d          5  t          j	        | |           ddd           dS # 1 swxY w Y   dS )	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    s     %%%


AJJq!yyyJ111	B	y(B	C	C	C    
B                                   s   0BBBc                  $   t          j        d           t          j                    } g d| j        d<   t          j                    }t          j        t          d          5  t          j	        | |           ddd           dS # 1 swxY w Y   dS )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    s     %%%


A#,99AG 	B	y(B	C	C	C    
B                                   s   "BB	B	c                      d} t          j        |                     d                    }t          j        |          }|j        d         dddk    sJ |j        d         dd	dk    sJ d
S )zPTests 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>   rs   ru   )r   rd   r   s      re   test_empty_attributer    sy    	A 
AHHW%%	&	&B
A73<577777773<544444444rg   )rD   r   networkxr>   networkx.readwrite.graphmlr   networkx.utilsr   r   r   rn   r   r  r  r  r  r  rl   rg   re   <module>r     sU   				      4 4 4 4 4 4 3 3 3 3 3 3 3 3l7 l7 l7 l7 l7 l7 l7 l7^	I6 I6 I6 I6 I6k I6 I6 I6Xr2 r2 r2 r2 r2{ r2 r2 r2j' ' ' ' '% ' ' '	  	  	 	  	  	 	  	  	 5 5 5 5 5rg   