code: def check_result(self, text, expected):
      self.assertEqual(expected, self.regexp.sub("", text))
  
imports: from idlelib import pyshell
  import unittest
  from test.support import requires
  from tkinter import Tk
label_desc: Use image node_id 3 for calling the PyShellRemoveLastNewlineAndSurroundingWhitespaceTest obj's underlying member method code with example usage: obj.check_result(text, expected) without return types