python flatten list of dicts