code: def launch_instance(
      instance_name,
      command,
      existing_ip=None,
      cpu=1,
      mem=4,
      code_dir=None,
      setup_command=None,
  ):
      """Launch a GCE instance."""
      # Create instance
      ip = existing_ip or create_instance(
          instance_name, cpu=cpu, mem=mem
      )
      tf.logging.info("Waiting for SSH %s", instance_name)
      ready = wait_for_ssh(ip)
      if not ready:
          raise ValueError(
              "Instance %s never ready for SSH" % instance_name
          )
  
      # Copy code
      if code_dir:
          shell_run_with_retry(
              COPY_CODE,
              retries=2,
              local_dir=code_dir,
              instance_name=instance_name,
          )
  
      # Run setup
      if setup_command:
          tf.logging.info("Running setup on %s", instance_name)
          remote_run(setup_command, instance_name)
  
      # Run command
      tf.logging.info("Running command on %s", instance_name)
      remote_run(command, instance_name, detach=True)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import contextlib
  import multiprocessing
  import os
  import socket
  import subprocess
  import time
  from tensor2tensor.utils import cloud_mlengine
  import tensorflow.compat.v1
label_desc: Use image node_id 9 for calling a global function with example usage: launch_instance(instance_name, command, existing_ip, cpu, mem, code_dir, setup_command) without return types