def group_pairs(pairs):
  out = {}
  for (x, y) in pairs:
    if x in out:
      out[x].append(y)
    else:
      out[x] = [y]
  return out
dataset/ETHPy150Open bloomreach/zinc/zinc.py/group_pairs/original