def METHOD_NAME(task_queue, task_empty_exception):
    while not task_queue.empty():
        try:
            task = task_queue.get_nowait()
        except task_empty_exception:
            break
        try:
            output = subprocess.check_output(task.cmd, stderr=subprocess.STDOUT,
                                             shell=True, universal_newlines=True)
            task.success = True
            task.output = output
            tag = "%sPASS:%s" % (PASS_COLOR, ENDC_COLOR)
        except subprocess.CalledProcessError as e:
            task.success = False
            task.output = e.output
            tag = "%sFAIL:%s" % (FAIL_COLOR, ENDC_COLOR)
        print("%s %s" % (tag, task.name))
        task_queue.task_done()