
    ިsg                        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y)    N)GraphMLWriter)edges_equalnodes_equalc                       e Zd Zed        Zy)BaseGraphMLc                    d| _         t        j                         | _        | j                  j	                  d       | j                  j                  ddd       | j                  j                  dd       | j                  j                  g d       t        j                  | j                   j                  d            | _
        d	| _        t        j                  d
      | _        ddi| j                  j                  d<   | j                  j	                  dd       | j                  j	                  dd       | j                  j	                  dd       | j                  j	                  d       | j                  j	                  dd       | j                  j                  dddd       | j                  j                  dddd       | j                  j                  dddd       | j                  j                  ddd       | j                  j                  ddd       | j                  j                  ddd       | j                  j                  ddd d!       t        j                  | j                  j                  d            | _        d"| _        t        j                  d
      | _        d#d$d$d%d%d&d'| j                   j                  d<   | j                   j	                  d       | j                   j	                  d       | j                   j                  ddd       t        j                  | j                  j                  d            | _        d(| _        t        j                         | _        | j&                  j	                  d)d*d+,       | j&                  j	                  d-d.d+,       | j&                  j                  d)d-d/0       t        j                  | j$                  j                  d            }|| _        d1| _        t        j                         | _        | j,                  j	                  dd23       | j,                  j	                  dd3       | j,                  j                  ddd23       | j,                  j                  ddd3       t        j                  | j*                  j                  d            }|| _        d4| _        t        j2                         | _        | j4                  j	                  d       | j4                  j                  ddd       | j4                  j                  d5d6g       t        j                  | j0                  j                  d            }|| _        d7| _        t        j:                         | _        | j<                  j	                  d       | j<                  j                  ddd       | j<                  j                  ddd       | j<                  j                  ddd       t        j                  | j8                  j                  d            }|| _        d8| _         t        j:                         | _!        | jB                  j	                  d       | jB                  j                  ddd       | jB                  j                  ddd       | jB                  j                  ddd       t        j                  | j@                  j                  d            }|| _"        d9| _#        t        j:                         | _$        | jH                  j	                  d       | jH                  j                  dd       | jH                  j                  ddd       | jH                  j                  ddd       t        j                  | jF                  j                  d            }|| _%        y ):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     X/var/www/html/venv/lib/python3.12/site-packages/networkx/readwrite/tests/test_graphml.pysetup_classz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__classmethodre    rf   rd   r   r   
   s    j7 j7rf   r   c                   x    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y)TestReadGraphMLc                 Z   | j                   }t        j                  | j                        }t	        |j                               t	        |j                               k(  sJ t	        |j                               t	        |j                               k(  sJ t	        |j                  d            t	        |j                  d            k(  sJ | j                  j                  d       t        j                  | j                        }t	        |j                               t	        |j                               k(  sJ t	        |j                               t	        |j                               k(  sJ t	        |j                  d            t	        |j                  d            k(  sJ y NTdatar   )
r?   r=   read_graphmlrF   sortednodesedgesseekparse_graphmlr<   selfr   HPGs       rd   !test_read_simple_directed_graphmlz1TestReadGraphML.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Hrf   c                    | j                   }t        j                  | j                        }t	        |j                         |j                               sJ t        |j                         |j                               sJ | j                  j                  d       t        j                  | j                        }t	        |j                         |j                               sJ t        |j                         |j                               sJ y Nr   )rV   r=   rr   rW   r   rt   r   ru   rv   rw   rT   rx   s       rd   #test_read_simple_undirected_graphmlz3TestReadGraphML.test_read_simple_undirected_graphmlG  s    ((OOD5561779aggi0001779aggi000!!&&q)d99:1779bhhj1111779bhhj111rf   c                    | j                   }t        j                  | j                        }t	        |j                         |j                               sJ t        |j                         |j                               sJ | j                  j                  d       t        j                  | j                        }t	        |j                         |j                               sJ t        |j                         |j                               sJ y r~   )rZ   r=   rr   r[   r   rt   r   ru   rv   rw   rX   rx   s       rd   'test_read_undirected_multigraph_graphmlz7TestReadGraphML.test_read_undirected_multigraph_graphmlR  s    &&OOD99:1779aggi0001779aggi000%%**1-d==>1779bhhj1111779bhhj111rf   c                    | j                   }t        j                  | j                        }t	        |j                         |j                               sJ t        |j                         |j                               sJ | j                  j                  d       t        j                  | j                        }t	        |j                         |j                               sJ t        |j                         |j                               sJ y r~   )r]   r=   rr   r^   r   rt   r   ru   rv   rw   r\   rx   s       rd   4test_read_undirected_multigraph_no_multiedge_graphmlzDTestReadGraphML.test_read_undirected_multigraph_no_multiedge_graphml]      33OODFFG1779aggi0001779aggi0002277:dJJK1779bhhj1111779bhhj111rf   c                    | j                   }t        j                  | j                        }t	        |j                         |j                               sJ t        |j                         |j                               sJ | j                  j                  d       t        j                  | j                        }t	        |j                         |j                               sJ t        |j                         |j                               sJ y r~   )r`   r=   rr   ra   r   rt   r   ru   rv   rw   r_   rx   s       rd   ?test_read_undirected_multigraph_only_ids_for_multiedges_graphmlzOTestReadGraphML.test_read_undirected_multigraph_only_ids_for_multiedges_graphmlh  r   rf   c                    | j                   }t        j                  | j                        }t	        |j                  d      t        |j                  d                  sJ t        |j                  d            }t        |j                  d            }t        ||      D ]  \  }}||k(  rJ  | j                  j                  d       t        j                  | j                        }t        |j                  d            t        |j                  d            k(  sJ t        |j                  d            }t        |j                  d            }t        ||      D ]  \  }}||k(  rJ  y ro   )rH   r=   rr   rJ   r   rt   rs   ru   ziprv   rw   rG   )ry   r   rz   geheabr{   s           rd   test_read_attribute_graphmlz+TestReadGraphML.test_read_attribute_graphmls  s:     OOD--.1774=&d1C*DEEEAGGG&'AGGG&'BK 	DAq6M6	q!d112aggdm$rxxTx/B(CCCCAGGG&'BHH$H'(BK 	DAq6M6	rf   c                     | j                   }t        j                  | j                        }|j                  d   |j                  d   k(  sJ y )Nr   )rL   r=   rr   rM   rI   )ry   r   rz   s      rd   #test_node_default_attribute_graphmlz3TestReadGraphML.test_node_default_attribute_graphml  sA    --OOD::;ww~&!''.*AAAArf   c                    d}t        j                  |j                  d            }t        j                  t
        j                  t
        j                  |       t        j                  t
        j                  t
        j                  |       y )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   	rC   rD   rE   pytestraisesr=   NetworkXErrorrr   rw   ry   src   s      rd    test_directed_edge_in_undirectedz0TestReadGraphML.test_directed_edge_in_undirected  X     ZZ)*b&&<b&&(8(8!<rf   c                    d}t        j                  |j                  d            }t        j                  t
        j                  t
        j                  |       t        j                  t
        j                  t
        j                  |       y )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      rd    test_undirected_edge_in_directedz0TestReadGraphML.test_undirected_edge_in_directed  r   rf   c                    d}t        j                  |j                  d            }t        j                  t
        j                  t
        j                  |       t        j                  t
        j                  t
        j                  |       y )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      rd   test_key_raisezTestReadGraphML.test_key_raise  sX    . ZZ)*b&&<b&&(8(8!<rf   c                    d}t        j                  |j                  d            }t        j                  t
        j                  t
        j                  |       t        j                  t
        j                  t
        j                  |       y )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      rd   test_hyperedge_raisez$TestReadGraphML.test_hyperedge_raise  sX    2 ZZ)*b&&<b&&(8(8!<rf   c                 N   d}t        j                  |j                  d            }t        j                  |      }ddg}t        |j                  d            |k(  sJ |j                  d       t        j                  |      }t        |j                  d            |k(  sJ y )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   )	rC   rD   rE   r=   rr   rs   ru   rv   rw   ry   r   rc   r   expectedrz   s         rd   test_multigraph_keysz$TestReadGraphML.test_multigraph_keys  s     ZZ)*OOB&(:;agg4g()X555

Qagg4g()X555rf   c                    t        j                         }|j                  d       |j                  d       |j                  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                  ||       |j                  d       t        j                  |t              }t        |j                  dd      |j                  dd            sJ |j                  |j                  k(  sJ |j                  j                         D 	ci c]k  \  }}t        |      |j                         D 	ci c]<  \  }}t        |      |j                         D 	ci c]  \  }}	t        |      |	 c}	}> c}	}}}m }
}}}}}}	|j                  d       t        j                  |t        t              }|
|j                  k(  sJ |j                  d       |j                         }t        j                   |t        t              }|
|j                  k(  sJ yc c}	}w c c}	}}}w c c}	}}}}}w )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)rq   r   )r   edge_key_typeN)r=   rY   r@   rB   rC   rD   write_graphmlrv   rr   intr   ru   _adjitemsstrreadrw   )ry   r   rc   rz   nodenbr_dictnbrkey_dictekeyddGadjHH	string_fhs                rd   test_preserve_multi_edge_dataz-TestReadGraphML.test_preserve_multi_edge_data  s   
 MMO	

1	

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

 h	 I%-^^%5 !C C9IJXT23t9b=JJ 
 
 	
__R3cBrww

GGI	i3cJrww K
s*   4'I%I I &II IIc                 J   d}t        j                  |j                  d            }t        j                  |d      }t        |j                               dgk(  sJ |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 |j                  d       t        j                  |      }t        |j                               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        |j                               dgk(  sJ |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        |j                               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 y )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   labelr6   2r   3
shape_type	rectanglezcom.yworks.flowchart.terminatordescriptionzdescription
line1
line2r   r   )rC   rD   rE   r=   rr   listru   has_edgert   rv   rw   )ry   rq   rc   r   rz   s        rd   test_yfiles_extensionz%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%,,,rf   c                    d}t        j                  |j                  d            }t        j                  |      }t        j
                  |      }||fD ]z  }|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   rzJ  y )
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   )rC   rD   rE   r=   rr   rw   rt   )ry   r   rc   r   rz   rI   s         rd   	test_boolzTestReadGraphML.test_bool  s    > ZZ)*OOBQV 	-E;;t$V,,,{{4(000{{4(000;;t$V,,,{{4(000;;t$V,,,	-rf   c                    d}d}d}||fD ]m  }t        j                  |j                  d            }t        j                  |      }t        j
                  |      }||fD ]  }|j                  d   d   rJ  o t        j                  |j                  d            }t        j                  t        j                  t        j                  |       t        j                  t        j                  t        j
                  |       y )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   )
rC   rD   rE   r=   rr   rw   rt   r   r   r   )	ry   goodbaduglyr   rc   r   rz   rI   s	            rd   test_graphml_header_linez(TestReadGraphML.test_graphml_header_line  s      	1AAHHW-.B#A  #AQ 1{{4(0001		1 ZZG,-b&&<b&&(8(8$?rf   c                    d}t        j                  |j                  d            }t        j                  |      }|j                  d      D cg c]  \  }}|	 }}}t        |      dk(  sJ |D ]  }|d   dk7  rJ  y c c}}w )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   Trp   	   CustomProperty )rC   rD   rE   r=   rr   rt   len)ry   rq   rc   r   _x	node_datas          rd    test_read_attributes_with_groupsz0TestReadGraphML.test_read_attributes_with_groups	  s    Zx ZZG,-OOBgg4g01da114yA~~ 	5I-."444	5 2s   Bc                 T   d}t        j                  |j                  d            }t        j                  |      }dddifg}t        |j                  d            |k(  sJ |j                  d       t        j                  |      }t        |j                  d            |k(  sJ y )	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  Trp   r   )	rC   rD   rE   r=   rr   rs   rt   rv   rw   r   s         rd   test_long_attribute_typez(TestReadGraphML.test_long_attribute_type-  s     ZZ)*OOBM4012agg4g()X555

Qagg4g()X555rf   N)rg   rh   ri   r|   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rk   rf   rd   rm   rm   9  sf    I	2	2	2	2"B
=$=$=8=<6.+Z~-@)-V1@fb5H	6rf   rm   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y)TestWriteGraphMLc                 V    t         j                          t        j                  d      }y )N
lxml.etree)r   re   r   importorskip)rb   r   s     rd   re   zTestWriteGraphML.setup_classH  s    !-rf   c                     	 dd l }t        j                  t        j                  k(  sJ y # t        $ r& t        j                  t        j
                  k(  sJ Y y w xY wr~   )
lxml.etreer=   r   write_graphml_lxmlImportErrorwrite_graphml_xml)ry   lxmls     rd   test_write_interfacez%TestWriteGraphML.test_write_interfaceM  sM    	<##r'<'<<<< 	<##r';';;;;	<s   '* ,AAc                 N   | j                   }d|j                  d<   t        j                         }| j	                  ||       |j                  d       t        j                  |      }t        |j                               t        |j                               k(  sJ t        |j                               t        |j                               k(  sJ t        |j                  d            t        |j                  d            k(  sJ | j                  j                  d       y )Ntherehir   Trp   r?   rI   rC   rD   writerrv   r=   rr   rs   rt   ru   rF   ry   r   rc   rz   s       rd   'test_write_read_simple_directed_graphmlz8TestWriteGraphML.test_write_read_simple_directed_graphmlU  s    &&ZZ\Ar

OOBaggi F1779$5555aggi F1779$5555agg4g()VAGGG4F-GGGG$$Q'rf   c                 v    t               }| j                  }|j                         }|j                  ||g       y N)r   r?   copy
add_graphs)ry   gmlwr   rz   s       rd   test_GraphMLWriter_add_graphsz.TestWriteGraphML.test_GraphMLWriter_add_graphsa  s/    &&FFHArf   c                 p   | j                   }d|j                  d<   d|j                  d<   t        j                         }| j	                  ||d       |j                  d       t        j                  |      }t        |j                               t        |j                               k(  sJ t        |j                               t        |j                               k(  sJ t        |j                  d	            t        |j                  d	            k(  sJ | j                  j                  d       y )
Nr   r   r6   r   F)prettyprintr   Trp   r   r   s       rd   %test_write_read_simple_no_prettyprintz6TestWriteGraphML.test_write_read_simple_no_prettyprintg  s    &&ZZ\Aru-

OOBaggi F1779$5555aggi F1779$5555agg4g()VAGGG4F-GGGG$$Q'rf   c                 d   ddl m} | j                  }t        j                         }| j                  ||d       |j                  d       t        j                  |      }|j                  d       t        |j                         |j                               sJ t        |j                         |j                               sJ t        |j                  d      |j                  d            sJ | j                  j                  d        ||      }t        |j                               }t!        |      dk(  sJ |d d D cg c]  }|j#                          }}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$                  ||	       |	j                  d       t        j                  |	      }t        j                         }
t        j$                  ||
d       |
j                  d       t        j                  |
      }t'        d t)        |j                  |j                        D              sJ t'        d t)        |j                  |j                        D              sJ y c c}w )Nr   parseT)named_key_idsrp         )r   r9   )	attr.namer9   )r   r5   r:   )r  r5   )r   r4   r   )r  r4   c              3   ,   K   | ]  \  }}||k(    y wr   rk   ).0r   r   s      rd   	<genexpr>zSTestWriteGraphML.test_write_read_attribute_named_key_ids_graphml.<locals>.<genexpr>       BR28B   c              3   ,   K   | ]  \  }}||k(    y wr   rk   )r
  r#   r$   s      rd   r  zSTestWriteGraphML.test_write_read_attribute_named_key_ids_graphml.<locals>.<genexpr>  r  r  )xml.etree.ElementTreer  rO   rC   rD   r   rv   r=   rr   r   rt   r   ru   rP   r   getrootr   r   r   allr   )ry   r  r   rc   rz   xmlchildrenchildr   default_behavior_fhnamed_key_ids_behavior_fhJs               rd   /test_write_read_attribute_named_key_ids_graphmlz@TestWriteGraphML.test_write_read_attribute_named_key_ids_graphmlt  sL   /..ZZ\Ar.

OOB

1779aggi0001779aggi0001777-qwwDw/ABBB'',,Q/Bi&8}!!!+3BQ<8%884yA~~"d1g---)T!W444$q')))%a000$q')))%a000 !jjl
/0  #OO/0$&JJL!
5TJ!&&q)OO56BC,ABBBBBC,ABBBB/ 9s   J-c                    ddl m} | j                  }t        j                         }| j                  ||d       |j                  d       t        j                  |      }|j                  d       t        |j                         |j                               sJ t        |j                         |j                               sJ t        |j                  d      |j                  d            sJ | j                  j                  d        ||      }t        |j                               }t!        |      dk(  sJ |d d D cg c]  }|j#                          }}t!        |      dk(  sJ d|d   v sJ d|d	   v sJ y c c}w )
Nr   r  Tinfer_numeric_typesrp   r  r   )z	attr.typedoubler:   )r  r  rR   rC   rD   r   rv   r=   rr   r   rt   r   ru   rS   r   r  r   r   )	ry   r  r   rc   rz   r  r  r  r   s	            rd   .test_write_read_attribute_numeric_type_graphmlz?TestWriteGraphML.test_write_read_attribute_numeric_type_graphml  sF   /--ZZ\Art4

OOB

1779aggi0001779aggi0001777-qwwDw/ABBB&&++A.Bi&8}!!!+3BQ<8%884yA~~&$q'111&$q'111	 9s   Fc                 `   t        j                         }|j                  ddg       |dz  }| j                  ||       t        j                  |      }|j                         sJ t        |j                  d      |j                  d            sJ |j                  |j                  k(  sJ y)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=   rY   rB   r   rr   is_multigraphr   ru   r   ry   tmp_pathr   fnamerz   s        rd   test_more_multigraph_keysz*TestWriteGraphML.test_more_multigraph_keys  s     MMO	-78>)AuOOE"   1777-qwwDw/ABBBvvrf   c                 v   t        j                  d      }|j                  ddd       t        j                  |g d       |j	                  ddd	       d
di|j
                  d<   ddi|j
                  d<   t        j                         }| j                  ||       |j                  d       t        j                  |t              }t        |j                         |j                               sJ t        |j                         |j                               sJ |j
                  |j
                  k(  sJ y )NFred)namer:   r   )r   r   )r   r:   r   r  r   r  r;   r   r   r   r"      edge_defaultr   r   )r=   rU   r@   add_pathrA   rI   rC   rD   r   rv   rr   r   r   rt   r   ru   r   s       rd   test_default_attributez'TestWriteGraphML.test_default_attribute  s    HH&!	

1AW
-
A|$	

1a
"#*H"5#+Q-ZZ\Ar

OOB#.1779aggi0001779aggi000ww!''!!!rf   c                    t        j                         }|j                  dd       |j                  dd       |j                  ddd       |j                  ddd       t	        j
                         }| j                  ||       |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 y )	Nr
   Fspecialr   r   r/  r
   r   r   r
   r   r:   r=   rY   r@   rA   rC   rD   r   rv   rr   rt   ru   r   s       rd   test_mixed_type_attributesz+TestWriteGraphML.test_mixed_type_attributes  s    MMO	

4
'	

4
#	

4u
-	

4q
)ZZ\Ar

OOB774=+++wwt}Y'1,,,77=))444ww}%i0A555rf   c                    t        j                         }|j                  dd       |j                  dd       |j                  ddd       |j                  ddd       t	        j
                         }| j                  ||       |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 y )	Nr
   hellor.  r   r   r/  r0  r1  r2  r   s       rd   %test_str_number_mixed_type_attributesz6TestWriteGraphML.test_str_number_mixed_type_attributes  s    MMO	

4
)	

4
#	

4w
/	

4q
)ZZ\Ar

OOBwwt}Y'7222wwt}Y'1,,,ww}%i0G;;;ww}%i0A555rf   c                 ~   t        j                  d      }t        j                         }|j	                  d|j                  d             |j	                  dd       |j                  dd|j                  d             |j                  ddd       t        j                         }| j                  ||       |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 y )Nnumpyr
   r   r.  r   r:   r   r  r/  r0  r1  )r   r   r=   rY   r@   int64rA   rC   rD   r   rv   rr   rt   ru   )ry   npr   rc   rz   s        rd   %test_mixed_int_type_number_attributesz6TestWriteGraphML.test_mixed_int_type_number_attributes  s     )MMO	

4!
-	

4
#	

4rxx{
3	

4q
)ZZ\Ar

OOBwwt}Y'1,,,wwt}Y'1,,,ww}%i0A555ww}%i0A555rf   c                    t        j                         }|j                  ddg       |dz  }| j                  ||       t        j                  |      }|j                         rJ t        j                  |d      }|j                         sJ |j                  ddd       |dz  }| j                  ||       t        j                  |      }|j                         sJ t        j                  |d      }|j                         sJ y )	Nr  )r   cr  r   Tr   r   r   ze-id)r=   rY   rB   r   rr   r!  rA   r"  s        rd   test_multigraph_to_graphz)TestWriteGraphML.test_multigraph_to_graph  s    MMO	-78>)AuOOE"??$$$OOED9    	


3V$>)AuOOE"   OOED9   rf   c                 n   ddl m} t        j                         }|j	                  g d       |j
                  D ci c]  }|t        |       }}t        j                  ||d       |dz  }| j                  ||d       t        j                  |d      }t        j                  |      }t        |j                         |j                               sJ t        |j                         |j                               sJ t        j                  ||d       t        |j                  d	      |j                  d	            sJ  ||      }	t        |	j                               }
t!        |
      d
k(  sJ |	j                         j#                  d      D cg c]  }|j$                  d    }}t'        |      t'        |j)                               k(  sJ dj+                  |      }t        j,                  |      }t'        |j                               t'        |j                               k(  sJ t'        |j                               t'        |j                               k(  sJ t        j                  ||d       t        |j                  d	      |j                  d	            sJ y c c}w c c}w )Nr   r  )r   r   r   r=  r   r=  eidr   edge_id_from_attributer   Trp   r   ..//{http://graphml.graphdrawing.org/xmlns}edger   )r  r  r=   rU   rB   ru   r   set_edge_attributesr   generate_graphmlrr   r   rt   r   r   r  r   findallattribrs   valuesjoinrw   )ry   r#  r  r   eedge_attributesr$  	generatorrz   treer  edgeedge_idsrq   r  s                  rd   *test_write_generate_edge_id_from_attributez;TestWriteGraphML.test_write_generate_edge_id_from_attribute  s1   /HHJ	=>./gg61c!f966
q/59>)AuU;''%H	OOE"1779aggi0001779aggi000
q/481777-qwwDw/A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
q/481777-qwwDw/ABBBE 7$
s   J-J2c                    ddl m} t        j                         }|j	                  g d       |j
                  D ci c]  }|t        |       }}t        j                  ||d       |dz  }| j                  ||d       t        j                  |d      }t        j                  |      }|j                         sJ t        j                  |d      }|j                         sJ t        |j                         |j                               sJ t        |j                         |j                               sJ t        d	 |j                  d
      D              t        |j!                               k(  sJ t        d |j                  d      D              t        |j!                               k(  sJ  ||      }	t#        |	j%                               }
t'        |
      dk(  sJ |	j%                         j)                  d      D cg c]  }|j*                  d    }}t        |      t        |j!                               k(  sJ dj-                  |      }t        j.                  |      }|j                         sJ t        |j                         |j                               sJ t        |j                         |j                               sJ t        d |j                  d
      D              t        |j!                               k(  sJ t        d |j                  d      D              t        |j!                               k(  sJ y c c}w c c}w )Nr   r  )r@  rA  rB  r@  rC  r   rD  Tr   c              3   F   K   | ]  \  }}}|j                  d         ywrC  Ngetr
  uvrq   s       rd   r  zYTestWriteGraphML.test_multigraph_write_generate_edge_id_from_attribute.<locals>.<genexpr>X       K*!QdhhuoK   !rp   c              3   (   K   | ]
  \  }}}|  y wr   rk   r
  rZ  r[  r   s       rd   r  zYTestWriteGraphML.test_multigraph_write_generate_edge_id_from_attribute.<locals>.<genexpr>\       >iaCc>   r   r   rF  r   r   c              3   F   K   | ]  \  }}}|j                  d         ywrV  rW  rY  s       rd   r  zYTestWriteGraphML.test_multigraph_write_generate_edge_id_from_attribute.<locals>.<genexpr>s  r\  r]  c              3   (   K   | ]
  \  }}}|  y wr   rk   r_  s       rd   r  zYTestWriteGraphML.test_multigraph_write_generate_edge_id_from_attribute.<locals>.<genexpr>w  r`  ra  )r  r  r=   rY   rB   ru   r   rG  r   rH  rr   r!  r   rt   r   rs   rK  r   r  r   rI  rJ  rL  rw   )ry   r#  r  r   rM  rN  r$  rO  rz   rP  r  rQ  rR  graphml_datar  s                  rd   5test_multigraph_write_generate_edge_id_from_attributezFTestWriteGraphML.test_multigraph_write_generate_edge_id_from_attributeD  s   /MMO	IJ./gg61c!f966
q/59>)AuU;''%H	OOE"   OOED9   1779aggi0001779aggi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1779aggi000KT8JKKv""$P
 
 	
 
 >1777+=>>&""$C
 
 	
 
] 74
s   M
Mc                    t        j                  d      }|j                  d      }t        j                  ddd|ifg      }|dz  }| j                  ||       t        j                  |t              }|j                  |j                  k(  sJ |d   d   d   }|d   d   d   }|t        j                  |d	      k(  sJ t        |      |j                  k(  sJ t        |      t        k(  sJ y 
Nr8  g333333@r:   r   r"   r   r   gư>)abs)r   r   float64r=   rU   r   rr   r   ru   approxtypefloat	ry   r#  r:  wtr   r$  rz   wtGwtHs	            rd   test_numpy_float64z#TestWriteGraphML.test_numpy_float64{        )ZZ_HHq!h^,-.>)AuOOES1ww!''!!!d1ghd1ghfmmCT2222CyBJJ&&&CyE!!!rf   c                    t        j                  d      }|j                  d      }t        j                  ddd|ifg      }|dz  }| j                  ||       t        j                  |t              }|j                  |j                  k(  sJ |d   d   d   }|d   d   d   }|t        j                  |d	      k(  sJ t        |      |j                  k(  sJ t        |      t        k(  sJ y rg  )r   r   float32r=   rU   r   rr   r   ru   rj  rk  rl  rm  s	            rd   test_numpy_float32z#TestWriteGraphML.test_numpy_float32  rr  rf   c                    t        j                  d      }| j                  }|j                  d      |j                  d   d<   |dz  }| j                  ||d       t        j                  |      }|j                  |j                  k(  sJ y )Nr8  r)   )r   r   r"   r   Tr  )	r   r   rR   ri  ru   r   r=   rr   r   )ry   r#  r:  r   r$  rz   s         rd   test_numpy_float64_inferencez-TestWriteGraphML.test_numpy_float64_inference  sx      )--*,**S/h'>)Au$7OOE"vvrf   c                 ~   t        j                         }t        d      t        d      z   t        d      z   }t        d      t        d      z   t        d      z   }t        }|j	                  |d|       |d	z  }| j                  ||       t        j                  ||
      }|j                  |j                  k(  sJ y )Ni(	  {   i  i  i  iD  	Radiohead)r   r   r   )r=   rU   chrr   rA   r   rr   r   )ry   r#  r   name1name2r   r$  rz   s           rd   test_unicode_attributesz(TestWriteGraphML.test_unicode_attributes  s    HHJD	CH$s4y0D	CI%C0		

5+5
1>)AuOOEY7vvrf   c                 V   dd l }ddi}|j                  |      }t        j                         }||j                  d<   t        j                         }| j                  ||       |j                  d       t        j                  |      }|j                  d   |j                  d   k(  sJ y )Nr   r   z{"a": "123"}r   )
jsondumpsr=   rU   rI   rC   rD   r   rv   rr   )ry   r  r   sar   rc   rz   s          rd   test_unicode_escapez$TestWriteGraphML.test_unicode_escape  s    .!ZZ]HHJZZ\Ar

OOBwwv!''&/111rf   N)rg   rh   ri   staticmethodr=   r   r   rj   re   r   r   r   r  r  r  r%  r,  r3  r6  r;  r>  rS  re  rq  ru  rw  r~  r  rk   rf   rd   r   r   E  s    "//0F. .<
( (+CZ24 "666 !('CR5
n"" 	 2rf   r   c                   @    e Zd Z eej
                        Zed        Zy)TestXMLGraphMLc                 ,    t         j                          y r   )r   re   )rb   s    rd   re   zTestXMLGraphML.setup_class  s    $$&rf   N)	rg   rh   ri   r  r=   r   r   rj   re   rk   rf   rd   r  r    s$    "../F' 'rf   r  c                  4   t        j                  d       t        j                         } | j	                  dg d       t        j                         }t        j                  t        d      5  t        j                  | |       ddd       y# 1 sw Y   yxY w)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=   rU   r@   rC   rD   r   	TypeErrorr   r   rc   s     rd   1test_exception_for_unsupported_datatype_node_attrr    sl     %

AJJqIJ.	B	y(B	C  
B     s   .BBc                  6   t        j                  d       t        j                         } | j	                  ddg d       t        j                         }t        j                  t        d      5  t        j                  | |       ddd       y# 1 sw Y   yxY w)	r  r   r   r:   r  r  r  r  N)
r   r   r=   rU   rA   rC   rD   r   r  r   r  s     rd   1test_exception_for_unsupported_datatype_edge_attrr    sn     %

AJJq!yJ1	B	y(B	C  
B     s   /BBc                  ,   t        j                  d       t        j                         } g d| j                  d<   t        j                         }t        j                  t        d      5  t        j                  | |       ddd       y# 1 sw Y   yxY w)r  r   r  r  r  r  N)
r   r   r=   rU   rI   rC   rD   r   r  r   r  s     rd   2test_exception_for_unsupported_datatype_graph_attrr    sk     %

A#,AGG 	B	y(B	C  
B     s   *B

Bc                      d} t        j                  | j                  d            }t        j                  |      }|j
                  d   dddk(  sJ |j
                  d   dd	dk(  sJ y
)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   r1   aaabbb)r   barr6   cccr   N)rC   rD   rE   r=   rr   rt   )r   rc   r   s      rd   test_empty_attributer    sf    	A 
AHHW%	&B
A773<57777773<54444rf   )rC   r   networkxr=   networkx.readwrite.graphmlr   networkx.utilsr   r   r   rm   r   r  r  r  r  r  rk   rf   rd   <module>r     s`    	   4 3l7 l7^	I6k I6Xr2{ r2j'% '	 	 	 5rf   