from typing import List
from typing import Dict


def flatten_dicts(dicts: List[Dict]) -> Dict:
  """Flatten a list of dicts

  Args:
    dicts (list): list of dicts

  Returns:
    dict: flattened dict
  """
  agg_dict = {}
  for d in dicts:
    for k, v in d.items():
      agg_dict.setdefault(k, []).append(v)
  return agg_dict