code: def main():
      spin = ["-", "/", "|", "\\", "-", "/", "|", "\\"]
      logGroupName = "/aws/batch/job"
  
      jobId = args.job_id
  
      spinner = 0
      running = False
      startTime = 0
  
      while True:
          time.sleep(1)
          describeJobsResponse = batch.describe_jobs(jobs=[jobId])
          job = describeJobsResponse["jobs"][0]
          status, jobName = job["status"], job["jobName"]
          if status == "SUCCEEDED" or status == "FAILED":
              print("=" * 80)
              print("Job [{} - {}] {}".format(jobName, jobId, status))
              break
          elif status == "RUNNING":
              logStreamName = getLogStream(logGroupName, jobName, jobId)
              if not running and logStreamName:
                  running = True
                  print(
                      "\rJob [{} - {}] is RUNNING.".format(
                          jobName, jobId
                      )
                  )
                  print(
                      "Output [{}]:\n {}".format(
                          logStreamName, "=" * 80
                      )
                  )
              if logStreamName:
                  startTime = (
                      printLogs(logGroupName, logStreamName, startTime)
                      + 1
                  )
          else:
              print(
                  "\rJob [%s - %s] is %-9s... %s"
                  % (jobName, jobId, status, spin[spinner % len(spin)]),
              )
              sys.stdout.flush()
              spinner += 1
  
file_path: gluon-nlp/tools/batch/wait-job.py
imports: import argparse
  from datetime import datetime
  import sys
  import time
  import boto3
  from botocore.compat import total_seconds
label_desc: Use image node_id 4 for calling a global function with example usage: main() without return types