def get_fields(d):
    """
    Recursive function to get all possible fields for the input dict

    """
    key_list = []
    for key,value in d.items():
        temp_key_list = [key]

        if type(value) == dict:
            temp_key_list.append(get_fields(value))

        key_list.append(temp_key_list)

    return key_list