code: def parse(
      program: Union[doc.AST, Any, str],
      extra_vars: Dict[str, Any] = None,
  ) -> Any:
      """Register a method for a operand type, AST operator node and operand index.
  
      Parameters
      ----------
      program : Union[doc.AST, Any, str]
          The TVMScript code to parse.
  
      extra_vars : Dict[str, Any]
          The extra variable table for parsing.
  
      Returns
      -------
      func : Any
          The parsed TVMScript program.
      """
      if extra_vars is None:
          extra_vars = _default_globals()
  
      ann = {}
      if inspect.isfunction(program):
          ann = {program.__name__: program.__annotations__}
      elif inspect.isclass(program):
          for name, func in program.__dict__.items():
              if inspect.isfunction(func):
                  ann[name] = func.__annotations__
  
      source = Source(program)
      parser = Parser(source, ann)
      with IRBuilder() as builder:
          try:
              parser.parse(extra_vars=extra_vars)
          except ParserError as err:
              parser.report_error(err.node, err.args[0])
      return builder.get()
  
file_path: tvm/python/tvm/script/parser/core/entry.py
imports: import inspect
  from typing import Any, Dict, Union
  from ...ir_builder import IRBuilder
  from .None import doc
  from .diagnostics import Source
  from .error import ParserError
  from .parser import Parser
label_desc: Use image node_id 3 for calling a global function with example usage: parse(program, extra_vars) and returns: builder