code: def monkey_patch(module_name, func_name):
      """Helper function for monkey-patching library functions.
  
      Used to modify a few sphinx-gallery behaviors to make the "Open in Colab" button work correctly.
      Should be called as a decorator with arguments. Note this behaves differently from unittest's
      @mock.patch, as our monkey_patch decorator should be placed on the new version of the function.
      """
      module = import_module(module_name)
      original_func = getattr(module, func_name)
  
      def decorator(function):
          updated_func = partial(function, real_func=original_func)
          setattr(module, func_name, updated_func)
          return updated_func
  
      return decorator
  
imports: from functools import partial
  import gc
  from importlib import import_module
  import inspect
  from hashlib import md5
  import os
  from pathlib import Path
  import re
  import sys
  from textwrap import dedent, indent
  from unittest.mock import patch
  import tvm
  from tvm import topi
  from tvm import te
  from tvm import testing
  from sphinx_gallery.sorting import ExplicitOrder
  import tlcpack_sphinx_addon
  from legacy_redirect import build_legacy_redirect
label_desc: Use image node_id 2 for calling a global function with example usage: monkey_patch(module_name, func_name) and returns: decorator, updated_func