code: def mocked_ipython(mocker):
      mocker.patch(
          "wandb.sdk.lib.ipython._get_python_type", lambda: "jupyter"
      )
      mocker.patch(
          "wandb.sdk.wandb_settings._get_python_type", lambda: "jupyter"
      )
      html_mock = mocker.MagicMock()
      mocker.patch("wandb.sdk.lib.ipython.display_html", html_mock)
      ipython = unittest.mock.MagicMock()
      ipython.html = html_mock
  
      def run_cell(cell):
          print("Running cell: ", cell)
          exec(cell)
  
      ipython.run_cell = run_cell
      # TODO: this is really unfortunate, for reasons not clear to me, monkeypatch doesn't work
      orig_get_ipython = wandb.jupyter.get_ipython
      orig_display = wandb.jupyter.display
      wandb.jupyter.get_ipython = lambda: ipython
      wandb.jupyter.display = lambda obj: html_mock(obj._repr_html_())
      yield ipython
      wandb.jupyter.get_ipython = orig_get_ipython
      wandb.jupyter.display = orig_display
  
imports: import os
  import platform
  import queue
  import subprocess
  import unittest.mock
  import pytest
  import wandb
  from wandb.sdk.interface.interface_queue import InterfaceQueue
  from wandb.sdk.internal import context
  from wandb.sdk.internal.sender import SendManager
  from wandb.sdk.internal.system.system_info import SystemInfo
label_desc: Use image node_id 8 for calling a global function with example usage: mocked_ipython(mocker) without return types