code: def cancel_from_client_demo():
      def iteration():
          for i in range(20):
              print(f"i: {i}")
              yield i
              time.sleep(0.5)
  
      def long_process():
          time.sleep(10)
          print("DONE!")
          return 10
  
      with gr.Blocks() as demo:
          num = gr.Number()
  
          btn = gr.Button(value="Iterate")
          btn.click(iteration, None, num, api_name="iterate")
          btn2 = gr.Button(value="Long Process")
          btn2.click(long_process, None, num, api_name="long")
  
      return demo
  
imports: import inspect
  import random
  import time
  import gradio
  import pytest
  from pydub import AudioSegment
label_desc: Use image node_id 7 for calling a global function with example usage: cancel_from_client_demo() and returns: demo, int