code: def count_generator_demo():
      def count(n):
          for i in range(int(n)):
              time.sleep(0.5)
              yield i
  
      def show(n):
          return str(list(range(int(n))))
  
      with gr.Blocks() as demo:
          with gr.Column():
              num = gr.Number(value=10)
              with gr.Row():
                  count_btn = gr.Button("Count")
                  list_btn = gr.Button("List")
          with gr.Column():
              out = gr.Textbox()
  
          count_btn.click(count, num, out)
          list_btn.click(show, num, out)
  
      return demo
  
imports: import inspect
  import random
  import time
  import gradio
  import pytest
  from pydub import AudioSegment
label_desc: Use image node_id 9 for calling a global function with example usage: count_generator_demo() and returns: demo, str