code: def inspect_function_capture(func: Callable) -> Dict[str, Any]:
      """Capture function non-locals and global variables.
  
      Parameters
      ----------
      func : Callable
          The function to inspect.
  
      Returns
      -------
      res : Dict[str, Any]
          The function variables map with non-local or global variables.
      """
      captured = {
          **func.__globals__,  # type: ignore
          **get_func_nonlocals(func),
      }
      return captured
  
file_path: tvm/python/tvm/script/parser/core/utils.py
imports: import inspect
  from types import FrameType
  from typing import Any, Callable, Dict, List
  from .diagnostics import findsource
label_desc: Use image node_id 2 for calling a global function with example usage: inspect_function_capture(func) and returns: captured