def _flatten_tree(tree, old_path=None):
flat_tree = []<EOL>for key, value in tree.items():<EOL><INDENT>new_path = "<STR_LIT:/>".join([old_path, key]) if old_path else key<EOL>if isinstance(value, dict) and "<STR_LIT>" not in value:<EOL><INDENT>flat_tree.extend(_flatten_tree(value, old_path=new_path))<EOL><DEDENT>else:<EOL><INDENT>flat_tree.append((new_path, value))<EOL><DEDENT><DEDENT>return flat_tree<EOL>
Flatten dict tree into dictionary where keys are paths of old dict.