def _find_match(needle: dict, haystack: list, keys: list):
    """Find a dictionary in a list of dictionary based on a set of keys"""
    for item in haystack:
        for key in keys:
            if item.get(key) != needle[key]:
                break
        else:
            return item
    return None