code: def stateful_chatbot():
      with gr.Blocks() as demo:
          chatbot = gr.Chatbot()
          msg = gr.Textbox()
          clear = gr.Button("Clear")
          st = gr.State([1, 2, 3])
  
          def respond(message, st, chat_history):
              assert st[0] == 1 and st[1] == 2 and st[2] == 3
              bot_message = "I love you"
              chat_history.append((message, bot_message))
              return "", chat_history
  
          msg.submit(
              respond,
              [msg, st, chatbot],
              [msg, chatbot],
              api_name="submit",
          )
          clear.click(lambda: None, None, chatbot, queue=False)
      return demo
  
imports: import inspect
  import random
  import time
  import gradio
  import pytest
  from pydub import AudioSegment
label_desc: Use image node_id 13 for calling a global function with example usage: stateful_chatbot() and returns: demo, str,  chat_history