code: def patch(module_name, func):
      module = wandb.util.get_module(module_name)
      success = False
  
      full_func = f"{module_name}.{func.__name__}"
      if not full_path_exists(full_func):
          wandb.termerror(
              f"Failed to patch {module_name}.{func.__name__}!  Please check if this package/module is installed!"
          )
      else:
          wandb.patched.setdefault(module.__name__, [])
          # if already patched, do not patch again
          if [module, func.__name__] not in wandb.patched[
              module.__name__
          ]:
              setattr(
                  module,
                  f"orig_{func.__name__}",
                  getattr(module, func.__name__),
              )
              setattr(module, func.__name__, func)
              wandb.patched[module.__name__].append(
                  [module, func.__name__]
              )
          success = True
  
      return success
  
file_path: wandb/wandb/integration/kfp/kfp_patch.py
imports: import inspect
  import itertools
  import textwrap
  from typing import Callable, List, Mapping, Optional
  from pkg_resources import parse_version
  import wandb
  from .wandb_logging import wandb_log
label_desc: Use image node_id 2 for calling a global function with example usage: patch(module_name, func) and returns: success