code: def main():
      # Find all jobs with job_name that are running or about to run and terminate them all.
      list_args = {
          "jobQueue": job_type,
          "filters": [{"name": "JOB_NAME", "values": [job_name]}],
      }
      try:
          response = batch.list_jobs(**list_args)
          for job in response["jobSummaryList"]:
              if job["status"] in [
                  "SUBMITTED",
                  "PENDING",
                  "RUNNABLE",
                  "STARTING",
                  "RUNNING",
              ]:
                  print(f'Terminate previous job {job["jobId"]}')
                  batch.terminate_job(
                      jobId=job["jobId"], reason="New job submitted"
                  )
      except Exception as e:
          print(
              f"Failed to terminate the job because of exception: {e}"
          )
  
imports: import argparse
  import boto3
  import re
label_desc: Use image node_id 1 for calling a global function with example usage: main() without return types