code: def _open_file_in_window(
      filename: t.Union[str, pathlib.Path], exit_after: bool = True
  ):
      from PyQt5.QtCore import (
          QUrl,
      )  # pylint: disable=import-outside-toplevel
      from PyQt5.QtWebEngineWidgets import (
          QWebEngineView,
      )  # pylint: disable=import-outside-toplevel
      from PyQt5.QtWidgets import (
          QApplication,
      )  # pylint: disable=import-outside-toplevel
  
      filepath = (
          pathlib.Path(filename)
          if isinstance(filename, str)
          else filename
      )
      try:
          app = QApplication.instance()
          if app is None:
              app = QApplication([])
              app.lastWindowClosed.connect(app.quit)
          web = QWebEngineView()
          web.setWindowTitle("deepchecks")
          web.setGeometry(0, 0, 1200, 1200)
          web.load(QUrl.fromLocalFile(str(filepath)))
          web.show()
          exit_code = app.exec_()
          if exit_after:
              sys.exit(exit_code)
      finally:
          filepath.unlink()
  
imports: import abc
  import html
  import io
  import pathlib
  import sys
  import typing
  from multiprocessing import get_context, process
  from tempfile import NamedTemporaryFile
  from IPython.core.display import display, display_html
  from ipywidgets import Widget
  from deepchecks.core.serialization.abc import HTMLFormatter, HtmlSerializer, IPythonSerializer, WidgetSerializer
  from deepchecks.utils.ipython import is_colab_env, is_databricks_env, is_kaggle_env, is_sagemaker_env, is_sphinx
  from deepchecks.utils.logger import get_logger
  from deepchecks.utils.strings import create_new_file_name, get_random_string, widget_to_html, widget_to_html_string
label_desc: Use image node_id 1 for calling a global function with example usage: _open_file_in_window(filename, exit_after) without return types