code: def testLGL(self):
      with temporary_file(
          """\
          # eggs
          spam 1
          # ham
          eggs 2
          bacon
          # bacon
          spam 3
          # spam
          spam"""
      ) as tmpfname:
          self._testNCOLOrLGL(func=Graph.Read_Lgl, fname=tmpfname)
  
      with temporary_file(
          """\
          # eggs
          spam
          # ham
          eggs
          bacon
          # bacon
          spam
          # spam
          spam"""
      ) as tmpfname:
          with warnings.catch_warnings():
              warnings.simplefilter("ignore")
              g = Graph.Read_Lgl(tmpfname)
          self.assertTrue(
              "name" in g.vertex_attributes()
              and "weight" not in g.edge_attributes()
          )
  
      # This is not an LGL file; we are testing error handling here
      with temporary_file(
          """\
          1 2
          1 3
          """
      ) as tmpfname:
          with self.assertRaises(InternalError):
              Graph.Read_Lgl(tmpfname)
  
imports: import gzip
  import io
  import unittest
  import warnings
  from igraph import Graph, InternalError
  from .utils import temporary_file
label_desc: Use image node_id 6 for calling the ForeignTests obj's underlying member method code with example usage: obj.testLGL() without return types