code: def test_add_feature_nx(self):
      (
          G,
          x,
          y,
          edge_x,
          edge_y,
          edge_index,
          graph_x,
          graph_y,
      ) = simple_networkx_graph()
      Graph.add_edge_attr(G, "edge_feature", edge_x)
      Graph.add_edge_attr(G, "edge_label", edge_y)
      Graph.add_node_attr(G, "node_feature", x)
      Graph.add_node_attr(G, "node_label", y)
      Graph.add_graph_attr(G, "graph_feature", graph_x)
      Graph.add_graph_attr(G, "graph_label", graph_y)
  
      self.assertEqual(len(G.edges.data()), edge_index.shape[1])
      for item in G.edges.data():
          self.assertEqual("edge_feature" in item[2], True)
          self.assertEqual("edge_label" in item[2], True)
          self.assertEqual(len(item[2]["edge_feature"]), 2)
          self.assertEqual(type(item[2]["edge_label"].item()), int)
  
      for item in G.nodes.data():
          self.assertEqual("node_feature" in item[1], True)
          self.assertEqual("node_label" in item[1], True)
          self.assertEqual(len(item[1]["node_feature"]), 2)
          self.assertEqual(type(item[1]["node_label"].item()), int)
  
      self.assertEqual(
          G.graph.get("graph_feature").eq(graph_x).sum().item(),
          2,
      )
      self.assertEqual(
          G.graph.get("graph_label").eq(graph_y).sum().item(),
          1,
      )
  
file_path: deepsnap/tests/test_graph.py
imports: import torch
  import unittest
  import numpy
  from tests.utils import simple_networkx_graph
  from deepsnap.graph import Graph
  from torch_geometric.datasets import Planetoid
label_desc: Use image node_id 1 for calling the TestGraph obj's underlying member method code with example usage: obj.test_add_feature_nx() without return types