def remove_unnecessary_self_time_nodes(frame, options):
if frame is None:<EOL><INDENT>return None<EOL><DEDENT>if len(frame.children) == <NUM_LIT:1> and isinstance(frame.children[<NUM_LIT:0>], SelfTimeFrame):<EOL><INDENT>child = frame.children[<NUM_LIT:0>]<EOL>frame.self_time += child.self_time<EOL>child.remove_from_parent()<EOL><DEDENT>for child in frame.children:<EOL><INDENT>remove_unnecessary_self_time_nodes(child, options=options)<EOL><DEDENT>return frame<EOL>
When a frame has only one child, and that is a self-time frame, remove that node, since it's
unnecessary - it clutters the output and offers no additional information.