code: def test_quotes(self, tmp_path):
      # https://github.com/networkx/networkx/issues/1061
      # Encoding quotes as HTML entities.
      G = nx.path_graph(1)
      G.name = "path_graph(1)"
      attr = 'This is "quoted" and this is a copyright: ' + chr(169)
      G.nodes[0]["demo"] = attr
      with open(tmp_path / "test.gml", "w+b") as fobj:
          nx.write_gml(G, fobj)
          fobj.seek(0)
          # Should be bytes in 2.x and 3.x
          data = fobj.read().strip().decode("ascii")
      answer = """graph [
    name "path_graph(1)"
    node [
      id 0
      label "0"
      demo "This is &#34;quoted&#34; and this is a copyright: &#169;"
    ]
  ]"""
      assert data == answer
  
imports: import codecs
  import io
  import math
  from ast import literal_eval
  from contextlib import contextmanager
  from textwrap import dedent
  import pytest
  import networkx
  from networkx.readwrite.gml import literal_destringizer, literal_stringizer
label_desc: Use image node_id 8 for calling the TestGraph obj's underlying member method code with example usage: obj.test_quotes(tmp_path) without return types