code: def test_is_block_opener(self):
      yes = self.assertTrue
      no = self.assertFalse
      p = self.parser
      setcode = p.set_code
      opener = p.is_block_opener
  
      TestInfo = namedtuple("TestInfo", ["string", "assert_"])
      tests = (
          TestInfo("def a():\n", yes),
          TestInfo(
              "\n   def function1(self, a,\n                 b):\n", yes
          ),
          TestInfo(":\n", yes),
          TestInfo("a:\n", yes),
          TestInfo("):\n", yes),
          TestInfo("(:\n", yes),
          TestInfo('":\n', no),
          TestInfo("\n   def function1(self, a,\n", no),
          TestInfo("def function1(self, a):\n    pass\n", no),
          TestInfo("# A comment:\n", no),
          TestInfo('"""A docstring:\n', no),
          TestInfo('"""A docstring:\n', no),
      )
  
      for test in tests:
          with self.subTest(string=test.string):
              setcode(test.string)
              test.assert_(opener())
  
imports: from idlelib import pyparse
  import unittest
  from collections import namedtuple
label_desc: Use image node_id 14 for calling the PyParseTest obj's underlying member method code with example usage: obj.test_is_block_opener() without return types