code: def end_subsegment(self, end_time=None):
          
          if not self.context.end_subsegment(end_time):
              return
  
          # if segment is already close, we check if we can send entire segment
          # otherwise we check if we need to stream some subsegments
          if self.current_segment().ready_to_send():
              self._send_segment()
          else:
              self.stream_subsegments()
docs: End the current active subsegment. If this is the last one open
          under its parent segment, the entire segment will be sent.
  
          :param float end_time: subsegment compeletion in unix epoch in seconds.