human
Complete this python program:
def execute(trans, tool, param_combinations, history, rerun_remap_job_id=None, collection_info=None, workflow_invocation_uuid=None):
assistant
#Here is the Python program you requested.

    """Execute a tool and return object containing summary (output data, number of
    failures, etc...).
    """
    all_jobs_timer = ExecutionTimer()
    execution_tracker = ToolExecutionTracker(tool, param_combinations, collection_info)
    app = trans.app
    execution_cache = ToolExecutionCache(trans)
    def execute_single_job(params):
        job_timer = ExecutionTimer()
        if workflow_invocation_uuid:
            params['__workflow_invocation_uuid__'] = workflow_invocation_uuid
        elif ('__workflow_invocation_uuid__' in params):
            del params['__workflow_invocation_uuid__']
        (job, result) = tool.handle_single_execution(trans, rerun_remap_job_id, params, history, collection_info, execution_cache)
        if job:
            message = (EXECUTION_SUCCESS_MESSAGE % (tool.id, job.id, job_timer))
            log.debug(message)
            execution_tracker.record_success(job, result)
        else:
            execution_tracker.record_error(result)
    config = app.config
    burst_at = getattr(config, 'tool_submission_burst_at', 10)
    burst_threads = getattr(config, 'tool_submission_burst_threads', 1)
    tool_action = tool.tool_action
    if hasattr(tool_action, 'check_inputs_ready'):
        for params in execution_tracker.param_combinations:
            tool_action.check_inputs_ready(tool, trans, params, history)
    job_count = len(execution_tracker.param_combinations)
    if ((job_count < burst_at) or (burst_threads < 2)):
        for params in execution_tracker.param_combinations:
            execute_single_job(params)
    else:
        q = Queue()
        def worker():
            while True:
                params = q.get()
                execute_single_job(params)
                q.task_done()
        for i in range(burst_threads):
            t = Thread(target=worker)
            t.daemon = True
            t.start()
        for params in execution_tracker.param_combinations:
            q.put(params)
        q.join()
    log.debug(('Executed    %d    job(s)    for    tool    %s    request:    %s' % (job_count, tool.id, all_jobs_timer)))
    if collection_info:
        history =...