'Handle flow table modification events'

def _handle_FlowTableModification(self, event):

    if (not event.removed):
        return
    if (event.reason in (OFPRR_IDLE_TIMEOUT, OFPRR_HARD_TIMEOUT, OFPRR_DELETE)):
        count = 0
        for entry in event.removed:
            if ((entry.flags & OFPFF_SEND_FLOW_REM) and (not (entry.flags & OFPFF_EMERG))):
                fr = entry.to_flow_removed(self._time, reason=event.reason)
                self.send(fr)
                count += 1
        self.log.debug('%d    flows    removed    (%d    removal    notifications)', len(event.removed), count)
