code: def add_callback(callbacks, fun):
      stack = [x for x in inspect.stack() if x.filename != __file__]
      filename = stack[0].filename if stack else "unknown file"
  
      callbacks.append(ScriptCallback(filename, fun))
  
imports: import inspect
  import os
  from collections import namedtuple
  from typing import Optional, Any
  from fastapi import FastAPI
  from gradio import Blocks
  from modules import errors, timer
label_desc: Use image node_id 23 for calling a global function with example usage: add_callback(callbacks, fun) without return types