def __str__(self):
    total_matched = sum(self.event2matched.values())
    total_timeouts = sum(self.event2timeouts.values())
    s = []
    s.append("Events matched: %d, timed out: %d\n" % (total_matched,
                                                      total_timeouts))
    s.append("Matches per event type:\n")
    for e, count in self.sorted_match_counts():
      s.append("  %s %d\n" % (e, count,))
      if e == "ControlMessageReceive":
        for pkt_class, c in self.msgrecv2matched.iteritems():
          s.append("\t\t  %s : %d\n" % (pkt_class, c))
      if e == "ControlMessageSend":
        for pkt_class, c in self.msgsend2matched.iteritems():
          s.append("\t\t  %s : %d\n" % (pkt_class, c))

    s.append("Timeouts per event type:\n")
    for e, count in self.sorted_timeout_counts():
      s.append("  %s %d\n" % (e, count,))
      if e == "ControlMessageReceive":
        for pkt_class, c in self.msgrecv2timeouts.iteritems():
          s.append("\t\t  %s : %d\n" % (pkt_class, c))
      if e == "ControlMessageSend":
        for pkt_class, c in self.msgsend2timeouts.iteritems():
          s.append("\t\t  %s : %d\n" % (pkt_class, c))

    return "".join(s)
dataset/ETHPy150Open ucb-sts/sts/sts/control_flow/event_scheduler.py/EventSchedulerStats.__str__/original