code: def add_nodes(self, G, graph_element):
      default = G.graph.get("node_default", {})
      for node, data in G.nodes(data=True):
          node_element = self.myElement("node", id=str(node))
          self.add_attributes("node", node_element, data, default)
          graph_element.append(node_element)
  
imports: import warnings
  from collections import defaultdict
  import networkx
  from networkx.utils import open_file
label_desc: Use image node_id 7 for calling the GraphMLWriter obj's underlying member method code with example usage: obj.add_nodes(G, graph_element) without return types