def extract_pairs(data_list, tag='mean_trajectory_return'):
  """Extract data from positive and negative alpha evaluations.

  Args:
    data_list: A list of dictionaries with data. Dictionary should contain 'pos'
      and 'neg' keys which represent going forward and backward in the parameter
      space. Each key should contain a dictionary of data that can be indexed by
      tag.
    tag: The key to index the data with.

  Returns:
    A list of tuples containing the extracted data.
  """
  extracted = []
  for data in data_list:
    extracted.append((data['pos'][tag], data['neg'][tag]))
    extracted.append((data['neg'][tag], data['pos'][tag]))
  return extracted