def _flatten_subsection(subsection, _type, offset, parent):
for row in subsection:<EOL><INDENT>if row in ('<STR_LIT>', '<STR_LIT>', '<STR_LIT>', ):<EOL><INDENT>continue<EOL><DEDENT>elif isinstance(row[<NUM_LIT:0>], StringType):<EOL><INDENT>if len(row) in (<NUM_LIT:4>, <NUM_LIT:5>, ):<EOL><INDENT>if len(row) == <NUM_LIT:5>:<EOL><INDENT>assert row[<NUM_LIT:4>][<NUM_LIT:0>] == '<STR_LIT:S>','<STR_LIT>' % row[<NUM_LIT:4>][<NUM_LIT:0>]<EOL><DEDENT>yield (float(row[<NUM_LIT:0>]), float(row[<NUM_LIT:1>]), float(row[<NUM_LIT:2>]), float(row[<NUM_LIT:3>]) / <NUM_LIT>,<EOL>_type, offset, parent)<EOL>parent = offset<EOL>offset += <NUM_LIT:1><EOL><DEDENT><DEDENT>elif isinstance(row[<NUM_LIT:0>], list):<EOL><INDENT>split_parent = offset - <NUM_LIT:1><EOL>start_offset = <NUM_LIT:0><EOL>slices = []<EOL>start = <NUM_LIT:0><EOL>for i, value in enumerate(row):<EOL><INDENT>if value == '<STR_LIT:|>':<EOL><INDENT>slices.append(slice(start + start_offset, i))<EOL>start = i + <NUM_LIT:1><EOL><DEDENT><DEDENT>slices.append(slice(start + start_offset, len(row)))<EOL>for split_slice in slices:<EOL><INDENT>for _row in _flatten_subsection(row[split_slice], _type, offset,<EOL>split_parent):<EOL><INDENT>offset += <NUM_LIT:1><EOL>yield _row<EOL><DEDENT><DEDENT><DEDENT><DEDENT>
Flatten a subsection from its nested version

    Args:
        subsection: Nested subsection as produced by _parse_section, except one level in
        _type: type of section, ie: AXON, etc
        parent: first element has this as it's parent
        offset: position in the final array of the first element

    Returns:
        Generator of values corresponding to [X, Y, Z, R, TYPE, ID, PARENT_ID]