def update_dict_of_lists(master, newdata):
 for (key, values) in newdata.items():
  master.setdefault(key, []).extend(values)

def update_dict_of_lists ( master , newdata ) : for ( key , values ) in newdata . items ( ) : master . setdefault ( key , [ ] ) . extend ( values )
extend the list values of master with those from newdata .