def run_parallel(commands, timeout=None, ignore_status=False, stdout_tee=None, stderr_tee=None):
 bg_jobs = []
 for command in commands:
  bg_jobs.append(BgJob(command, stdout_tee, stderr_tee, stderr_level=get_stderr_level(ignore_status)))
 join_bg_jobs(bg_jobs, timeout)
 for bg_job in bg_jobs:
  if ((not ignore_status) and bg_job.result.exit_status):
   raise error.CmdError(command, bg_job.result, 'Command returned non-zero exit status')
 return [bg_job.result for bg_job in bg_jobs]

def run_parallel ( commands , timeout = None , ignore_status = False , stdout_tee = None , stderr_tee = None ) : bg_jobs = [ ] for command in commands : bg_jobs . append ( BgJob ( command , stdout_tee , stderr_tee , stderr_level = get_stderr_level ( ignore_status ) ) ) join_bg_jobs ( bg_jobs , timeout ) for bg_job in bg_jobs : if ( ( not ignore_status ) and bg_job . result . exit_status ) : raise error . CmdError ( command , bg_job . result , 'Command returned non-zero exit status' ) return [ bg_job . result for bg_job in bg_jobs ]
behaves the same as run() with the following exceptions: - commands is a list of commands to run in parallel .