code: def test_get_region(self):
      get = self.formatter.get_region
      text = self.text
      eq = self.assertEqual
  
      # Add selection.
      text.tag_add("sel", "7.0", "10.0")
      expected_lines = [
          "",
          "    def compare(self):",
          "        if a > b:",
          "",
      ]
      eq(
          get(),
          ("7.0", "10.0", "\n".join(expected_lines), expected_lines),
      )
  
      # Remove selection.
      text.tag_remove("sel", "1.0", "end")
      eq(get(), ("15.0", "16.0", "\n", ["", ""]))
  
imports: from idlelib import format
  import unittest
  from unittest import mock
  from test.support import requires
  from tkinter import Tk, Text
  from idlelib.editor import EditorWindow
  from idlelib.idle_test.mock_idle import Editor
label_desc: Use image node_id 5 for calling the FormatRegionTest obj's underlying member method code with example usage: obj.test_get_region() without return types