code: def emit_stack_effect_function(
      out: CWriter, direction: str, data: list[tuple[str, str]]
  ) -> None:
      out.emit(
          f"extern int _PyOpcode_num_{direction}(int opcode, int oparg);\n"
      )
      out.emit("#ifdef NEED_OPCODE_METADATA\n")
      out.emit(
          f"int _PyOpcode_num_{direction}(int opcode, int oparg)  {{\n"
      )
      out.emit("switch(opcode) {\n")
      for name, effect in data:
          out.emit(f"case {name}:\n")
          out.emit(f"    return {effect};\n")
      out.emit("default:\n")
      out.emit("    return -1;\n")
      out.emit("}\n")
      out.emit("}\n\n")
      out.emit("#endif\n\n")
  
imports: import argparse
  import os.path
  import sys
  from analyzer import Analysis, Instruction, analyze_files, Skip, Uop
  from generators_common import DEFAULT_INPUT, ROOT, write_header, cflags, StackOffset
  from cwriter import CWriter
  from typing import TextIO
  from stack import get_stack_effect
label_desc: Use image node_id 3 for calling a global function with example usage: emit_stack_effect_function(out, direction, data) without return types