class_docstr: This controls a job:
  - instantiate each of the tasks
  - sends timeout signal
  - stops all tasks if one of them finishes
  - cleans up the tasks/closes log files when deleted
class_docstr_tok: ["This","controls","a","job",":","-","instantiate","each","of","the","tasks","-","sends","timeout","signal","-","stops","all","tasks","if","one","of","them","finishes","-","cleans","up","the","tasks\/closes","log","files","when","deleted"]
code: def run(self, max_retry: int = 6) -> None:
      # max_retry is a safety measure, the submission also have a timeout_countdown,
      # and will fail if it times out too many times.
      for _ in range(max_retry):
          try:
              self.start_tasks()
              exit_codes = self.wait()
              requeue = any(
                  e == LOCAL_REQUEUE_RETURN_CODE for e in exit_codes
              )
              if not requeue:
                  break
          finally:
              self.kill_tasks()
  
imports: import os
  import shlex
  import signal
  import subprocess
  import sys
  import time
  import typing
  from pathlib import Path
  from ..core import core, job_environment, logger, utils
  from ..core.core import R
label_desc: Use image node_id 6 for calling the Controller obj's underlying member method code with example usage: obj.run(max_retry) without return types