um, missing another loop after `d = ...`:
d = defaultdict(list)
  for f in FROM:
     for k, v in FROM.iteritems():
          d[k].append(v)