code: def get_displaylines(text, index):
      """Display height, in lines, of a logical line in a Tk text widget."""
      return text.count(
          f"{index} linestart", f"{index} lineend", "displaylines"
      )
  
imports: import contextlib
  import functools
  import itertools
  import tkinter
  from tkinter.font import Font
  from idlelib.config import idleConf
  from idlelib.delegator import Delegator
  from idlelib import macosx
label_desc: Use image node_id 3 for calling a global function with example usage: get_displaylines(text, index) and returns: text