code: def toggle_code_context_event(self, event=None):
      if not self.label:
          # Calculate the border width and horizontal padding required to
          # align the context with the text in the main Text widget.
          #
          # All values are passed through int(str(<value>)), since some
          # values may be pixel objects, which can't simply be added to ints.
          widgets = self.editwin.text, self.editwin.text_frame
          # Calculate the required vertical padding
          padx = 0
          for widget in widgets:
              padx += int(str(widget.pack_info()["padx"]))
              padx += int(str(widget.cget("padx")))
          # Calculate the required border width
          border = 0
          for widget in widgets:
              border += int(str(widget.cget("border")))
          self.label = Tkinter.Label(
              self.editwin.top,
              text="\n" * (self.context_depth - 1),
              anchor=W,
              justify=LEFT,
              font=self.textfont,
              bg=self.bgcolor,
              fg=self.fgcolor,
              width=1,  # don't request more than we get
              padx=padx,
              border=border,
              relief=SUNKEN,
          )
          # Pack the label widget before and above the text_frame widget,
          # thus ensuring that it will appear directly above text_frame
          self.label.pack(
              side=TOP,
              fill=X,
              expand=False,
              before=self.editwin.text_frame,
          )
      else:
          self.label.destroy()
          self.label = None
      idleConf.SetOption(
          "extensions",
          "CodeContext",
          "visible",
          str(self.label is not None),
      )
      idleConf.SaveUserCfgFiles()
  
file_path: catboost/contrib/tools/python/src/Lib/idlelib/CodeContext.py
imports: import Tkinter
  from Tkconstants import TOP, LEFT, X, W, SUNKEN
  import re
  from sys import maxint
  from idlelib.configHandler import idleConf
label_desc: Use image node_id 2 for calling the CodeContext obj's underlying member method code with example usage: obj.toggle_code_context_event(event) without return types