def validate_panel(result):
    all_good = True
    all_results = list(itertools.chain(*result.values()))
    debater_roles = zip(*all_results)

    # Check everyone is in the same position
    for debater in debater_roles:
        ds = [(d,rl) for (d,rl,s,r) in debater]
        if not all(x == ds[0] for x in ds):
            all_good = False
            break

    # Check the winner makes sense
    final_winner = max([(len(v), k) for k,v in result.iteritems()])[1]
    debater_roles = zip(*result[final_winner])
    for debater in debater_roles:
        ds = [(d,rl) for (d,rl,s,r) in debater]
        if ((len(ds) != len(result[final_winner])) or
            (len(ds) < 2)):
            all_good = False
            break

    return all_good, "Inconsistent Panel results, please check yourself"
dataset/ETHPy150Open jolynch/mit-tab/mittab/apps/tab/forms.py/validate_panel/original