code: def remote_run(cmd, instance_name, detach=False, retries=1):
      """Run command on GCS instance, optionally detached."""
      if detach:
          cmd = SCREEN.format(command=cmd)
      args = SSH.format(instance_name=instance_name).split()
      args.append(cmd)
      for i in range(retries + 1):
          try:
              if i > 0:
                  tf.logging.info("Retry %d for %s", i, args)
              return sp.check_call(args)
          except sp.CalledProcessError as e:
              if i == retries:
                  raise e
  
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 1 for calling a global function with example usage: remote_run(cmd, instance_name, detach, retries) and returns: sp