def all_keys(input):
    """
    Recursive function. Get every keyname in every descendant of a dictionary.
    Iterates down on list and dict structures to search for more dicts with
    keys.
    """
    values = []
    if isinstance(input, dict):
        values = list(input.keys())
        for key in list(input.keys()):
            values = values + all_keys(input[key])
    if isinstance(input, list):
        for value in input:
            valleys = all_keys(value)
            for val in valleys:
                values.append(val)
    return values