if result_tree is None:
    all_combos.append(current_combo)
return
for word in result_tree:
    new_current_combo = current_combo[:]
new_current_combo.append({'word': word['word']})
flatten_combinations(word['next'], new_current_combo, all_combos)
return all_combos
Find all paths through a tree (nested dicts) from top to bottom