code: def _append_traceback_frame(
      tb, func_name, filepath, lineno: Optional[int]
  ):
      """Append a dummy frame to appear in the Python traceback"""
  
      # Compile a dummy function to Python bytecode, so that with the
      # filepath that we want to appear in the traceback.  Any external
      # debugger (e.g. pdb) that catches the exception will use the
      # filepath to show code snippets from that FFI file.
      header = "" if lineno is None else "\n" * (lineno - 1)
      code = compile(
          f"{header}def dummy_func(): raise NotImplementedError()",
          filepath,
          "exec",
      )
  
      # Replacing the name by updating the bytecode allows the function
      # name to be values that would normally be forbidden by python
      # syntax.  For example, "operator()".
      code = code.replace(
          co_consts=(
              code.co_consts[0].replace(co_name=func_name),
              func_name,
              None,
          )
      )
      namespace = {}
      exec(code, namespace)  # pylint: disable=exec-used
      dummy_func = namespace["dummy_func"]
  
      # Execute the dummy function in order to generate a stack frame.
      dummy_tb = None
      try:
          dummy_func()
      except NotImplementedError as err:
          dummy_tb = err.__traceback__
  
      # Insert the dummy function into the stack trace.
      new_frame = dummy_tb.tb_next
      return types.TracebackType(
          tb,
          new_frame.tb_frame,
          new_frame.tb_lasti,
          new_frame.tb_lineno,
      )
  
imports: import ctypes
  import functools
  import os
  import re
  import sys
  import types
  from typing import Callable, Sequence, Optional
  import numpy
  from .None import libinfo
label_desc: Use image node_id 11 for calling a global function with example usage: _append_traceback_frame(tb, func_name, filepath, lineno) and returns: types