code: def launch_gce(*, vm_name: str, startup_script: str):
      # Note : Use `gcloud compute images list --project ml-images` to get a list
      # of available VM images.
      args = [
          "gcloud",
          "compute",
          "instances",
          "create",
          vm_name,
          f"--project={FLAGS.project}",
          f"--zone={FLAGS.zone}",
          "--image=c1-deeplearning-tf-2-10-cu113-v20221107-debian-10",
          "--image-project=ml-images",
          f"--machine-type={FLAGS.machine_type}",
          "--scopes=cloud-platform,storage-full",
          "--boot-disk-size=256GB",
          "--boot-disk-type=pd-ssd",
          "--metadata=install-nvidia-driver=True",
          f"--metadata-from-file=startup-script={startup_script}",
      ]
      if FLAGS.accelerator_type and FLAGS.accelerator_count:
          args.extend(
              [
                  "--maintenance-policy=TERMINATE",
                  f"--accelerator=type={FLAGS.accelerator_type},count={FLAGS.accelerator_count}",
              ]
          )
  
      if FLAGS.dry_run:
          print()
          print("Would run the following command without --dry-run:")
          print()
          print(" \\\n    ".join(args))
          print()
          return
  
      print()
      print(
          "Creating instance on GCE... This will take some minutes..."
      )
      print()
      result = subprocess.run(args)
      if result.returncode:
          raise RuntimeError("Could not create VM!")
  
file_path: flax/examples/cloud/launch_gce.py
imports: import datetime
  import os
  import re
  import subprocess
  import time
  from typing import Sequence
  from absl import app
  from absl import flags
label_desc: Use image node_id 2 for calling a global function with example usage: launch_gce() without return types