docstr: Tests that edges order can be preserved when importing from networks.
docstr_tok: ["Tests","that","edges","order","can","be","preserved","when","importing","from","networks","."]
code: def test_order_preserving(self):
      """Tests that edges order can be preserved when importing from networks."""
      graph = nx.DiGraph()
      for node_index in range(4):
          graph.add_node(node_index, features=np.array([node_index]))
      receivers = [0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3]
      senders = [1, 2, 3, 0, 2, 3, 0, 1, 3, 0, 1, 2]
      for edge_index, (receiver, sender) in enumerate(
          zip(receivers, senders)
      ):
          # Removing the "index" key makes this test fail 100%.
          edge_data = {
              "features": np.array([edge_index]),
              "index": edge_index,
          }
          graph.add_edge(sender, receiver, **edge_data)
      graph.graph["features"] = np.array([0.0])
      graphs_graph = utils_np.networkx_to_data_dict(graph)
      self.assertAllEqual(receivers, graphs_graph["receivers"])
      self.assertAllEqual(senders, graphs_graph["senders"])
      self.assertAllEqual(
          [[x] for x in range(4)], graphs_graph["nodes"]
      )
      self.assertAllEqual(
          [[x] for x in range(12)], graphs_graph["edges"]
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import itertools
  from absl.testing import parameterized
  from graph_nets import utils_np
  from graph_nets.tests import test_utils
  import networkx
  import numpy
  from six.moves import range
  import tensorflow
label_desc: Use image node_id 1 for calling the NetworkxConversionTest obj's underlying member method code with example usage: obj.test_order_preserving() without return types