def one_question_winner(question, result, num_cast_votes):
  """
  determining the winner for one question
  """
  # sort the answers , keep track of the index
  counts = sorted(enumerate(result), key=lambda(x): x[1])
  counts.reverse()

  # if there's a max > 1, we assume that the top MAX win
  if question['max'] > 1:
    return [c[0] for c in counts[:question['max']]]

  # if max = 1, then depends on absolute or relative
  if question['result_type'] == 'absolute':
    if (num_cast_votes/2 + 1) >=  counts[0][1]:
      return [counts[0][0]]
    else:
      return []

  if question['result_type'] == 'relative':
    return [counts[0][0]]
dataset/ETHPy150Open benadida/helios-server/helios/crypto/electionalgs.py/one_question_winner/swapped operands of `>=`