def check_if_key_exists(a_key, expected_dict):
    """
    Return True or False if a_key exists in the expected_dict dictionary.
    """
    for key, value in expected_dict.items():
        if key == a_key:
            return True
        elif isinstance(value, dict):
            return check_if_key_exists(a_key, value)
        elif isinstance(value, list):
            for list_item in value:
                if isinstance(list_item, dict):
                    return check_if_key_exists(a_key, list_item)
    return False