code: def run_with_timeout(b, config):
      max_time = config.timeout
      with timeout_signal(max_time):
          try:
              cleanup_container = []
  
              def runner():
                  result = b.run(config.data_dir)
                  if result is not None:
                      assert callable(result)
                      cleanup_container.append(result)
  
              timer = timeit.Timer(runner).timeit(1)
  
              if cleanup_container:
                  [cleanup] = cleanup_container
                  assert callable(cleanup)
                  cleanup()
  
              return timer, False
          except Py4JError as e:
              if _timeout_state:
                  return max_time, True
              raise
          except BenchmarkTimeoutError as e:
              return max_time, True
  
imports: import timeit
  import contextlib
  import hail
  import logging
  import os
  import re
  import shutil
  import signal
  from py4j.protocol import Py4JError
  from .resources import all_resources
label_desc: Use image node_id 9 for calling a global function with example usage: run_with_timeout(b, config) and returns: timer,  False, max_time,  True, max_time,  True