code: def wait(
      batch_id: int,
      quiet: Ann[
          bool,
          Opt(
              "--quiet",
              "-q",
              help="Do not print a progress bar for the batch.",
          ),
      ] = False,
      output: StructuredFormatPlusTextOption = StructuredFormatPlusText.TEXT,
  ):
      """Wait for the batch with id BATCH_ID to complete, then print status."""
      from hailtop.batch_client.client import (
          BatchClient,
      )  # pylint: disable=import-outside-toplevel
  
      with BatchClient("") as client:
          batch = get_batch_if_exists(client, batch_id)
          if batch is None:
              print(f"Batch with id {batch_id} not found")
              raise typer.Exit(1)
  
          quiet = quiet or output != StructuredFormatPlusText.TEXT
          out = batch.wait(disable_progress_bar=quiet)
          if output == StructuredFormatPlusText.JSON:
              print(json.dumps(out))
          else:
              print(out)
  
imports: import asyncio
  from enum import Enum
  import typer
  from typer import Option, Argument
  import json
  from typing import Optional, List, Annotated, cast, Dict, Any
  from .None import list_batches
  from .None import billing
  from .initialize import async_basic_initialize
  from .None import submit
  from .batch_cli_utils import get_batch_if_exists, get_job_if_exists, make_formatter, StructuredFormat, StructuredFormatOption, StructuredFormatPlusText, StructuredFormatPlusTextOption, ExtendedOutputFormat, ExtendedOutputFormatOption
label_desc: Use image node_id 6 for calling a global function with example usage: wait(batch_id, quiet, output) without return types