def __list_contains_dict(self,com_list,com_dict,compare_eles): d_keys = com_dict.keys() for ele in compare_eles: if ele not in d_keys: return False for c_dict in com_list: c_keys = c_dict.keys() t_dict_contains_keys = True for ele in compare_eles: if ele not in c_keys: t_dict_contains_keys = False break if not t_dict_contains_keys: continue all_match = True for ele in compare_eles: all_match = all_match and (c_dict[ele] == com_dict[ele]) if all_match: return True return False