code: def format_title(title: str):
      title = title.replace(" ", "_")
      title = re.sub(r"[^a-zA-Z0-9\-._]", "", title)
      title = re.sub("-+", "-", title)
      while title.startswith("."):
          title = title[1:]
      return title
  
file_path: gradio/gradio/cli/commands/deploy_space.py
imports: from __future__ import annotations
  import os
  import re
  from typing import Optional
  import huggingface_hub
  from rich import print
  from typer import Option
  from typing_extensions import Annotated
  import gradio
label_desc: Use image node_id 2 for calling a global function with example usage: format_title(title) and returns: title