python utility for list of dictionary