def node_indent(elt_name, node_id, fact_term, attribute, highlight_node=None):
<EOL>color_dict = {<NUM_LIT:0>: {<NUM_LIT:0>: '<STR_LIT>', <EOL><NUM_LIT:1>: '<STR_LIT>',<EOL><NUM_LIT:2>: '<STR_LIT>',<EOL><NUM_LIT:3>: '<STR_LIT>',<EOL><NUM_LIT:4>: '<STR_LIT>',<EOL><NUM_LIT:5>: '<STR_LIT>',<EOL><NUM_LIT:6>: '<STR_LIT>',<EOL><NUM_LIT:7>: '<STR_LIT>',<EOL><NUM_LIT:8>: '<STR_LIT>',<EOL><NUM_LIT:9>: '<STR_LIT>',<EOL><NUM_LIT:10>: '<STR_LIT>',<EOL><NUM_LIT:11>: '<STR_LIT>',<EOL><NUM_LIT:12>: '<STR_LIT>',<EOL><NUM_LIT>: '<STR_LIT>',<EOL><NUM_LIT>: '<STR_LIT>'},<EOL><NUM_LIT:2>: {<NUM_LIT:0>: '<STR_LIT>', <EOL><NUM_LIT:1>: '<STR_LIT>',<EOL><NUM_LIT:2>: '<STR_LIT>',<EOL><NUM_LIT:3>: '<STR_LIT>',<EOL><NUM_LIT:4>: '<STR_LIT>',<EOL><NUM_LIT:5>: '<STR_LIT>',<EOL><NUM_LIT:6>: '<STR_LIT>',<EOL><NUM_LIT:7>: '<STR_LIT>',<EOL><NUM_LIT:8>: '<STR_LIT>',<EOL><NUM_LIT:9>: '<STR_LIT>',<EOL><NUM_LIT:10>: '<STR_LIT>',<EOL><NUM_LIT:11>: '<STR_LIT>',<EOL><NUM_LIT:12>: '<STR_LIT>',<EOL><NUM_LIT>: '<STR_LIT>',<EOL><NUM_LIT>: '<STR_LIT>'},<EOL><NUM_LIT:3>: {<NUM_LIT:0>: '<STR_LIT>', <EOL><NUM_LIT:1>: '<STR_LIT>',<EOL><NUM_LIT:2>: '<STR_LIT>',<EOL><NUM_LIT:3>: '<STR_LIT>',<EOL><NUM_LIT:4>: '<STR_LIT>',<EOL><NUM_LIT:5>: '<STR_LIT>',<EOL><NUM_LIT:6>: '<STR_LIT>',<EOL><NUM_LIT:7>: '<STR_LIT>',<EOL><NUM_LIT:8>: '<STR_LIT>',<EOL><NUM_LIT:9>: '<STR_LIT>',<EOL><NUM_LIT:10>: '<STR_LIT>',<EOL><NUM_LIT:11>: '<STR_LIT>',<EOL><NUM_LIT:12>: '<STR_LIT>',<EOL><NUM_LIT>: '<STR_LIT>',<EOL><NUM_LIT>: '<STR_LIT>', },<EOL><NUM_LIT:1>: {<NUM_LIT:0>: "<STR_LIT>", <EOL><NUM_LIT:1>: "<STR_LIT>",<EOL><NUM_LIT:2>: "<STR_LIT>",<EOL><NUM_LIT:3>: "<STR_LIT>",<EOL><NUM_LIT:4>: "<STR_LIT>",<EOL><NUM_LIT:5>: "<STR_LIT>",<EOL><NUM_LIT:6>: "<STR_LIT>",<EOL><NUM_LIT:7>: "<STR_LIT>",<EOL><NUM_LIT:8>: "<STR_LIT>",<EOL><NUM_LIT:9>: "<STR_LIT>",<EOL><NUM_LIT:10>: "<STR_LIT>",<EOL><NUM_LIT:11>: "<STR_LIT>",<EOL><NUM_LIT:12>: "<STR_LIT>",<EOL><NUM_LIT>: "<STR_LIT>",<EOL><NUM_LIT>: "<STR_LIT>"}<EOL>}<EOL>indents = <NUM_LIT:100><EOL>node_ids = node_id.split('<STR_LIT::>')<EOL>fact_components = fact_term.split('<STR_LIT:/>')<EOL>if len(fact_components) == <NUM_LIT:1> and fact_components[<NUM_LIT:0>] == '<STR_LIT>':<EOL><INDENT>fact_components = []<EOL><DEDENT>if attribute:<EOL><INDENT>fact_components.append("<STR_LIT>" % attribute)<EOL><DEDENT>fact_components = dict([(x, fact_components[x]) for x in range(<NUM_LIT:0>, len(fact_components))])<EOL>result = []<EOL>counter = <NUM_LIT:0><EOL>for node in node_ids:<EOL><INDENT>is_attr = False<EOL>if len(node) >= <NUM_LIT:1>:<EOL><INDENT>if node[<NUM_LIT:0>] == '<STR_LIT:A>':<EOL><INDENT>is_attr = True<EOL><DEDENT>node = node[<NUM_LIT:1>:]<EOL><DEDENT>if len(node) > <NUM_LIT:0>:<EOL><INDENT>node_nr = int(node)<EOL><DEDENT>else:<EOL><INDENT>node_nr = <NUM_LIT:0><EOL><DEDENT>if is_attr:<EOL><INDENT>node_mod = <NUM_LIT:2><EOL><DEDENT>else:<EOL><INDENT>node_mod = node_nr % <NUM_LIT:2><EOL><DEDENT>if is_attr:<EOL><INDENT>result.append("<STR_LIT>" % {<EOL>'<STR_LIT>': elt_name,<EOL>'<STR_LIT>': fact_components.get(counter, '<STR_LIT>'),<EOL>'<STR_LIT>': color_dict[<NUM_LIT:2>][max(<NUM_LIT> - counter,<NUM_LIT:4>)]})<EOL><DEDENT>else:<EOL><INDENT>result.append(<EOL>"<STR_LIT>" % {<EOL>'<STR_LIT>': elt_name,<EOL>'<STR_LIT>': color_dict[node_mod][max(<NUM_LIT> - counter,<NUM_LIT:4>)],<EOL>'<STR_LIT>': fact_components.get(counter, '<STR_LIT>')})<EOL><DEDENT>counter += <NUM_LIT:1><EOL><DEDENT>highlight = "<STR_LIT>" if highlight_node == node_id else None<EOL>result.append("<STR_LIT>" % {'<STR_LIT>': elt_name, '<STR_LIT>': (indents - counter), '<STR_LIT>' : highlight})<EOL>return "<STR_LIT>".join(result)<EOL>
This tag uses a table structure to display indentation
of fact terms based on the information contained in the
node identifier.

This tag and the closing 'node_indent_end' tag must
enclose the value to be displayed after the display
of the fact term.