def process_pair(idx, df):
  """Parse the result of a given pairwise comparison.

  Args:
    idx: a starting row in the raw comparison dataframe
    df: raw comparison dataframe

  Returns:
    wide representation of the comparison
  """

  pair = int(df.loc[idx, 0].split(' ')[1])
  indicators_left, indicators_right, row = [], [], []

  idx = idx + 6

  while df.loc[idx, 0] != 'Evaluation 2':
    val_left = df.loc[idx, 1]
    val_right = df.loc[idx, 4]

    indicators_left.append(val_left)
    indicators_right.append(val_right)

    idx += 1

  num_question = len(indicators_left)
  acc_left = sum(indicators_left)
  acc_right = sum(indicators_right)

  q1 = process_eval2(idx + 2, pair, df)
  q2 = process_eval2(idx + 4, pair, df)
  q3 = process_eval2(idx + 6, pair, df)

  row = [pair, num_question, acc_left, acc_right, q1, q2, q3]

  return row, idx + 7
Parse the result of a given pairwise comparison.

  Args:
    idx: a starting row in the raw comparison dataframe
    df: raw comparison dataframe

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