code: def gallery_app(
      name: str,
      yes_arg: bool,
      version_arg: str,
      cwd: Optional[str] = None,
      overwrite: bool = False,
  ) -> str:
      # make sure org/app-name syntax is correct
      org, app = _validate_name(
          name, resource_type="app", example="lightning/quick-start"
      )
  
      # resolve registry (orgs can have a private registry through their environment variables)
      registry_url = _resolve_app_registry()
  
      # load the app resource
      app_entry = _resolve_resource(
          registry_url,
          name=name,
          version_arg=version_arg,
          resource_type="app",
      )
  
      # give the user the chance to do a manual install
      (
          source_url,
          git_url,
          folder_name,
          git_sha,
      ) = _show_install_app_prompt(
          app_entry, app, org, yes_arg, resource_type="app"
      )
  
      # run installation if requested
      _install_app_from_source(
          source_url,
          git_url,
          folder_name,
          cwd=cwd,
          overwrite=overwrite,
          git_sha=git_sha,
      )
  
      return os.path.join(
          os.getcwd(), folder_name, app_entry["appEntrypointFile"]
      )
  
imports: import os
  import re
  import shutil
  import subprocess
  import sys
  from typing import Dict, Optional, Tuple
  import click
  import requests
  from packaging.version import Version
  from lightning.app.core.constants import LIGHTNING_APPS_PUBLIC_REGISTRY, LIGHTNING_COMPONENT_PUBLIC_REGISTRY
  from lightning.app.utilities.app_helpers import Logger
label_desc: Use image node_id 9 for calling a global function with example usage: gallery_app(name, yes_arg, version_arg, cwd, overwrite) and returns: os