docs: def get_window():
      """Get IDA's top level window."""
      tform = idaapi.get_current_tform()
  
      # Required sometimes when closing IDBs and not IDA.
      if not tform:
          tform = idaapi.find_tform("Output window")
  
      widget = form_to_widget(tform)
      window = widget.window()
      return window