code: def mocked_module(monkeypatch):
      """This allows us to mock modules loaded via wandb.util.get_module."""
  
      def mock_get_module(module):
          orig_get_module = wandb.util.get_module
          mocked_module = MagicMock()
  
          def get_module(mod):
              if mod == module:
                  return mocked_module
              else:
                  return orig_get_module(mod)
  
          monkeypatch.setattr(wandb.util, "get_module", get_module)
          return mocked_module
  
      return mock_get_module
  
imports: import io
  import os
  import pathlib
  import shutil
  from contextlib import contextmanager
  from typing import Any, Dict, List
  from unittest.mock import MagicMock, patch
  import nbformat
  import pytest
  import wandb
  import wandb.util
  from nbclient import NotebookClient
  from nbclient.client import CellExecutionError
  from wandb.sdk.lib.ipython import PythonType
label_desc: Use image node_id 1 for calling a global function with example usage: mocked_module(monkeypatch) and returns: mock_get_module, mocked_module, mocked_module, orig_get_module