code: def test_mocked_notebook_magic(
      user, wandb_init, run_id, test_settings, mocked_ipython
  ):
      magic = wandb.jupyter.WandBMagics(None)
      basic_settings = {
          k: v
          for k, v in dict(test_settings({"run_id": run_id})).items()
          if k in ("base_url", "api_key", "run_id")
      }
      magic.wandb(
          "",
          """with wandb.init(settings=wandb.Settings(**%s)):
          wandb.log({"a": 1})"""
          % basic_settings,
      )
      wandb.finish()
      displayed_html = [
          args[0].strip()
          for args, _ in mocked_ipython.html.call_args_list
      ]
      for i, html in enumerate(displayed_html):
          print(f"[{i}]: {html}")
      assert wandb.jupyter.__IFrame is None
      # if versions are different this will fail (make sure you are up-to-date with master)
      assert len(displayed_html) == 8
      assert "<iframe" in displayed_html[2]
      run_uri = f"{user}/uncategorized/runs/{run_id}"
      magic.wandb(run_uri)
      displayed_html = [
          args[0].strip()
          for args, _ in mocked_ipython.html.call_args_list
      ]
      for i, html in enumerate(displayed_html):
          print(f"[{i}]: {html}")
      assert f"{run_uri}?jupyter=true" in displayed_html[-1]
  
imports: import json
  import os
  import pathlib
  import platform
  import subprocess
  import sys
  from unittest import mock
  import pytest
  import wandb
  import wandb.jupyter
  import wandb.sdk.lib.apikey
  import wandb.util
label_desc: Use image node_id 14 for calling a global function with example usage: test_mocked_notebook_magic(user, wandb_init, run_id, test_settings, mocked_ipython) without return types