code: def remove_unnecessary_self_time_nodes(frame, options):
      '''
      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.
      '''
      if frame is None:
          return None
  
      if len(frame.children) == 1 and isinstance(frame.children[0], SelfTimeFrame):
          child = frame.children[0]
          frame.self_time += child.self_time
          child.remove_from_parent()
      
      for child in frame.children:
          remove_unnecessary_self_time_nodes(child, options=options)
      
      return framf remove_unnecessary_self_time_nodes(frame, options):
      '''
      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.
      '''
      if frame is None:
          return None
  
      if len(frame.children) == 1 and isinstance(frame.children[0], SelfTimeFrame):
          child = frame.children[0]
          frame.self_time += child.self_time
          child.remove_from_parent()
      
      for child in frame.children:
          remove_unnecessary_self_time_nodes(child, options=options)
      
      return frame
docs: 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.