def process_eval2(idx, pair, df):
  """Determine the result of each pairwise comparison in Evaluation 2

  ("tie" vs "left" vs "right"). If comparison is not made or made incorrecntly
  (more than one options checked),
  the result is forced to be a "tie" and the warning message is printed.

  Args:
    idx: current row in the raw comparison dataframe
    pair: index of the pairwise comparison
    df: raw comparison dataframe

  Returns:
    result of the comparison
  """

  values = [df.loc[idx, 1], df.loc[idx, 3], df.loc[idx, 5]]

  if sum(values) != 1:
    print(f'Eval 2 for pair {pair} has an issue (zero or more than one checkbox'
          'selected) -- I substitute it with \"tie\", but please investigate!')
    return 'tie'

  return 'tie' if values[0] else 'left' if values[1] else 'right'
Determine the result of each pairwise comparison in Evaluation 2

  ("tie" vs "left" vs "right"). If comparison is not made or made incorrecntly
  (more than one options checked),
  the result is forced to be a "tie" and the warning message is printed.

  Args:
    idx: current row in the raw comparison dataframe
    pair: index of the pairwise comparison
    df: raw comparison dataframe

  Returns:
    result of the comparison
  
language/asqa/human_annotation/analysis.py