code: def run_subprocess_with_timeout(timeout, args):
      attempts_remaining = 5
      delay = 1
      p = None
      while True:
          try:
              p = run_subprocess(
                  args, stdout=subprocess.PIPE, stderr=subprocess.PIPE
              )
              stdout, stderr = p.communicate(timeout=timeout)
              return p, stdout, stderr
          except subprocess.TimeoutExpired as e:
              print >> sys.stderr, "timeout running {0}, error {1}, delay {2} seconds".format(
                  args, str(e), delay
              )
              if p is not None:
                  try:
                      p.kill()
                      p.wait(timeout=1)
                  except Exception:
                      pass
              attempts_remaining -= 1
              if attempts_remaining == 0:
                  raise
              time.sleep(delay)
              delay = min(2 * delay, 4)
  
imports: import sys
  import os
  import re
  import subprocess
  import signal
  import time
  import json
  import argparse
  import errno
  import process_command_files
  import process_whole_archive_option
label_desc: Use image node_id 3 for calling a global function with example usage: run_subprocess_with_timeout(timeout, args) and returns: p,  stdout,  stderr