code: def _widget_redirector(parent):  # htest #
      from tkinter import Toplevel, Text
  
      top = Toplevel(parent)
      top.title("Test WidgetRedirector")
      x, y = map(int, parent.geometry().split("+")[1:])
      top.geometry("+%d+%d" % (x, y + 175))
      text = Text(top)
      text.pack()
      text.focus_set()
      redir = WidgetRedirector(text)
  
      def my_insert(*args):
          print("insert", args)
          original_insert(*args)
  
      original_insert = redir.register("insert", my_insert)
  
file_path: cpython/Lib/idlelib/redirector.py
imports: from tkinter import TclError
label_desc: Use image node_id 1 for calling a global function with example usage: _widget_redirector(parent) without return types