def _repr_tree_defs(data, indent_str=None):
lines = []<EOL>nodes = data.items()<EOL>for i, (mod, (sub, files)) in enumerate(sorted(nodes, key=lambda x: x[<NUM_LIT:0>])):<EOL><INDENT>if not files:<EOL><INDENT>files = "<STR_LIT>"<EOL><DEDENT>else:<EOL><INDENT>files = "<STR_LIT>" % "<STR_LIT:U+002C>".join(sorted(files))<EOL><DEDENT>if indent_str is None:<EOL><INDENT>lines.append("<STR_LIT>" % (mod, files))<EOL>sub_indent_str = "<STR_LIT:U+0020>"<EOL><DEDENT>else:<EOL><INDENT>lines.append(r"<STR_LIT>" % (indent_str, mod, files))<EOL>if i == len(nodes) - <NUM_LIT:1>:<EOL><INDENT>sub_indent_str = "<STR_LIT>" % indent_str<EOL><DEDENT>else:<EOL><INDENT>sub_indent_str = "<STR_LIT>" % indent_str<EOL><DEDENT><DEDENT>if sub:<EOL><INDENT>lines.append(_repr_tree_defs(sub, sub_indent_str))<EOL><DEDENT><DEDENT>return "<STR_LIT:\n>".join(lines)<EOL>
return a string which represents imports as a tree