def get_all_values(nested_dictionary, values=None, hierarchy=None, prefix=None, strip=None):
    """
    Recursively builds a dictionary of all the leaves in a nested dictionary.

    Args:
        nested_dictionary: The nested dictionary to traverse.
        values: The current set of extracted leaf values.
        hierarchy: The hierarchy for the keys.
        prefix: Any prefix to add to the keys.
        strip: Any value which should be stripped from the hierarchy.

    Returns:
        The dictionary of leaf values.
    """
    values = {} if values is None else values
    hierarchy = [] if hierarchy is None else hierarchy
    prefix = [] if prefix is None else prefix

    for key, value in nested_dictionary.items():
        path = hierarchy + [key]

        try:
            path.remove(strip)
        except:
            pass

        if type(value) is dict:
            values = {**get_all_values(value, hierarchy=path, prefix=prefix, strip=strip), **values}
        else:
            values = {'.'.join(prefix + path): value, **values}

    return values