def Filter(self, pkt):
        if _debug: ReadPropertySummary._debug("Filter %r", pkt)
        global requests

        # apply the filters
        if filterSource:
            if not Match(pkt.pduSource, filterSource):
                if _debug: ReadPropertySummary._debug("    - source filter fail")
                return
        if filterDestination:
            if not Match(pkt.pduDestination, filterDestination):
                if _debug: ReadPropertySummary._debug("    - destination filter fail")
                return
        if filterHost:
            if (not Match(pkt.pduSource, filterHost)) and (not Match(pkt.pduDestination, filterHost)):
                if _debug: ReadPropertySummary._debug("    - host filter fail")
                return
        if filterEval:
            try:
                matches = eval(filterEval, {'pkt':pkt})
                if not matches:
                    if _debug: ReadPropertySummary._debug("    - eval filter fail")
                    return
            except:
                if _debug: ReadPropertySummary._debug("    - eval filter massive fail")
                return

        # check for reads
        if isinstance(pkt, ReadPropertyRequest):
            key = (pkt.pduSource, pkt.pduDestination, pkt.apduInvokeID)
            if requests in key:
                if _debug: ReadPropertySummary._debug("    - retry")
                requests[key].retry += 1
            else:
                if _debug: ReadPropertySummary._debug("    - new request")
                msg = Traffic(pkt)
                requests[key] = msg
                traffic.append(msg)

        # now check for results
        elif isinstance(pkt, ReadPropertyACK):
            key = (pkt.pduDestination, pkt.pduSource, pkt.apduInvokeID)
            req = requests.get(key, None)
            if req:
                if _debug: ReadPropertySummary._debug("    - matched with request")
                requests[key].resp = pkt

                # delete the request, it stays in the traffic list
                del requests[key]
            else:
                if _debug: ReadPropertySummary._debug("    - unmatched")

#
#   __main__
#
dataset/ETHPy150Open JoelBender/bacpypes/pcap_tools/ReadPropertySummaryFilter.py/ReadPropertySummary.Filter/swapped operands of `in`