code: def close_all():
      r
  
      # Windows can be closed by releasing all references to them so they can be
      # garbage collected. May not be necessary to call close().
      global _qtg_windows
      for window in _qtg_windows:
          window.close()
      _qtg_windows = []
  
      global _qtg_widgets
      for widget in _qtg_widgets:
          widget.close()
      _qtg_widgets = []
  
      global _plt_figures
      for fig in _plt_figures:
          _, plt, _ = _import_plt()
          plt.close(fig)
      _plt_figures = []
docs: r"""Close all opened windows.