code: def main(
      demo_path: Path,
      demo_name: str = "demo",
      watch_dirs: Optional[List[str]] = None,
      encoding: str = "utf-8",
  ):
      # default execution pattern to start the server and watch changes
      module_name, path, watch_dirs, demo_name = _setup_config(
          demo_path, demo_name, watch_dirs, encoding
      )
      # extra_args = args[1:] if len(args) == 1 or args[1].startswith("--") else args[2:]
      popen = subprocess.Popen(
          [sys.executable, "-u", path],
          env=dict(
              os.environ,
              GRADIO_WATCH_DIRS=",".join(watch_dirs),
              GRADIO_WATCH_MODULE_NAME=module_name,
              GRADIO_WATCH_DEMO_NAME=demo_name,
          ),
      )
      popen.wait()
  
file_path: gradio/gradio/cli/commands/reload.py
imports: from __future__ import annotations
  import inspect
  import os
  import re
  import subprocess
  import sys
  import threading
  from pathlib import Path
  from typing import List, Optional
  import typer
  from rich import print
  import gradio
  from gradio import utils
label_desc: Use image node_id 2 for calling a global function with example usage: main(demo_path, demo_name, watch_dirs, encoding) without return types