human
Complete the below
def flatten_tree_structure(root_list):

    ''''Flatten a tree.'
    '''
assistant
#Here is the Python program you requested.
    elements = []
    def generate(input_list, indent_levels_so_far):
        'Generate    flat    list    of    nodes.'
        for (index, element) in enumerate(input_list):
            elements.append(element)
            indent_levels = (indent_levels_so_far + [(index, len(input_list))])
            element.indent_levels = indent_levels
            children = element.get_children()
            element.children_count = len(children)
            generate(children, indent_levels)
    generate(root_list, [])
    level = 0
    last_element = None
    for element in elements:
        new_level = len(element.indent_levels)
        change = (new_level - level)
        if (last_element is not None):
            last_element.indent_change_after = change
        element.indent_change_before = change
        level = new_level
        last_element = element
    if (last_element is not None):
        last_element.indent_change_after = (- level)
    return elements