code: def test_get_num_lines_in_stmt(self):
      eq = self.assertEqual
      p = self.parser
      setcode = p.set_code
      getlines = p.get_num_lines_in_stmt
  
      TestInfo = namedtuple("TestInfo", ["string", "lines"])
      tests = (
          TestInfo("[x for x in a]\n", 1),  # Closed on one line.
          TestInfo("[x\nfor x in a\n", 2),  # Not closed.
          TestInfo(
              "[x\\\nfor x in a\\\n", 2
          ),  # "", unneeded backslashes.
          TestInfo("[x\nfor x in a\n]\n", 3),  # Closed on multi-line.
          TestInfo('\n"""Docstring comment L1"""\nL2\nL3\nL4\n', 1),
          TestInfo('\n"""Docstring comment L1\nL2"""\nL3\nL4\n', 1),
          TestInfo(
              '\n"""Docstring comment L1\\\nL2\\\nL3\\\nL4\\\n', 4
          ),
          TestInfo(
              '\n\n"""Docstring comment L1\\\nL2\\\nL3\\\nL4\\\n"""\n',
              5,
          ),
      )
  
      # Blank string doesn't have enough elements in goodlines.
      setcode("")
      with self.assertRaises(IndexError):
          getlines()
  
      for test in tests:
          with self.subTest(string=test.string):
              setcode(test.string)
              eq(getlines(), test.lines)
  
imports: from idlelib import pyparse
  import unittest
  from collections import namedtuple
label_desc: Use image node_id 10 for calling the PyParseTest obj's underlying member method code with example usage: obj.test_get_num_lines_in_stmt() without return types