def present_question(display_num, question_id, question_text, buzzes, final,
                     correct, score, power="10"):

    even_delta = 0
    odd_delta = 0
    question_value = 15

    # Find out where the computer would buzz
    computer_position = (max(question_text) + 1, 0)
    for ss in sorted(question_text):
        words = question_text[ss].split()
        for ii, ww in enumerate(words):
            current_guesses = buzzes.current_guesses(question_id, ss, ii)
            buzz_now = [x for x in current_guesses.values() if x.final]
            if len(buzz_now) == 1:
                computer_position = ss, ii
                computer_guess = buzz_now[0].page
                break

    question_text[ss] += " ".join([kPADDING] * 5) % " %s "

    question_done = False
    human_delta = 0
    computer_delta = 0
    human_answers = 0
    computer_answers = 0
    for ss in sorted(question_text):
        words = question_text[ss].split()
        for ii, ww in enumerate(words):
            if question_done or human_answers==2:
                break

            if computer_position[0] == ss and computer_position[1] == ii:
                # This is where the computer buzzes
                if human_delta <= 0:
                    if computer_guess == correct:
                        if human_answers == 2:
                            answer(computer_guess.split("(")[0])
                            computer_answers += 1
                            question_done = True
                        os.system("afplay sounds/applause.wav")
                        if human_delta <= 0:
                            computer_delta = question_value
                    else:
                        answer(computer_guess.split("(")[0])
                        computer_answers += 1
                        os.system("afplay sounds/sad_trombone.wav")
                        if human_delta == 0:
                            computer_delta = -5
                else:
                    answer(computer_guess.split("(")[0])
                    computer_answers += 1
                    question_done = True
                    computer_delta = 0

            current_guesses = buzzes.current_guesses(question_id, ss, ii)
            if lower(ww).startswith(lower(power)):
                question_value = 10
            press = interpret_keypress()

            if isinstance(press, int):
                # Check to see if buzz is valid
                if human_delta > 0:
                    continue
                if even_delta != 0 and press % 2 == 0:
                    continue
                if odd_delta != 0 and press % 2 != 0:
                    continue
                human_answers += 1

                os.system("afplay /System/Library/Sounds/Glass.aiff")
                response = None
                while response is None:
                    response = raw_input("Player %i, provide an answer:\t"
                                         % press)
                    if '+' in response:
                        if press % 2 == 0:
                            even_delta = question_value
                        else:
                            odd_delta = question_value
                        if computer_delta < 0 and human_delta == 0:
                            human_delta = question_value
                            question_done = True
                        elif computer_delta == 0 and human_delta == 0:
                            human_delta = question_value
                    elif '-' in response:
                        if even_delta == 0 and press % 2 != 0 and ww != kPADDING:
                            odd_delta = -5
                        if odd_delta == 0 and press % 2 == 0 and ww != kPADDING:
                            even_delta = -5
                        if computer_delta == 0:
                            human_delta = -5

                        # Break if both teams have answered
                        if even_delta != 0 and press % 2 != 0:
                            question_done = True
                        if odd_delta != 0 and press % 2 == 0:
                            question_done = True
                    else:
                        response = None
            # Don't buzz if anyone else has gotten it wrong
            else:
                show_score(score.even + even_delta,
                           score.odd + odd_delta,
                           "TEAM A", "TEAM B",
                           left_color="RED",
                           right_color="YELLOW")
                show_score(score.human + human_delta,
                           score.computer + computer_delta,
                           "HUMAN", "COMPUTER",
                           flush=False)


                print(format_display(display_num, question_text, ss, ii + 1,
                                     current_guesses, answer=correct,
                                     points=question_value))

    # Now see what the computer would do
    if computer_delta == 0 and human_delta <= 0 and computer_answers == 0:
        show_score(score.even + even_delta,
                   score.odd + odd_delta,
                   "TEAM A", "TEAM B",
                   left_color="RED",
                   right_color="YELLOW")
        show_score(score.human + human_delta,
                   score.computer + computer_delta,
                   "HUMAN", "COMPUTER",
                   flush=False)
        print(format_display(display_num, question_text, max(question_text) - 1,
                             1000, current_guesses, answer=correct,
                             points=computer_delta))
        answer(final.split('(')[0])
        if final == correct:
            computer_delta = 10
        else:
            print("Computer guesses incorrectly: %s" % final)
    elif computer_delta > 0 and computer_answers == 0:
        format_display(display_num, question_text, computer_position[0],
                       computer_position[1], current_guesses, answer=correct,
                       points=computer_delta)
        answer(computer_guess)

    return score.add(Score(even_delta, odd_delta, human_delta, computer_delta))
dataset/ETHPy150Open Pinafore/qb/util/2p_buzzer.py/present_question/swapped operands of `%`