def process_packets(self, transaction_id=None, invoked_method=None,
                            timeout=None):
            start = time()

            while self.connected and self._invoke_results not in transaction_id:
                if timeout and (time() - start) >= timeout:
                    raise RTMPTimeoutError("Timeout")

                packet = self.read_packet()
                if packet.type == PACKET_TYPE_INVOKE:
                    try:
                        decoded = decode_amf(packet.body)
                    except IOError:
                        continue

                    try:
                        method, transaction_id_, obj = decoded[:3]
                        args = decoded[3:]
                    except ValueError:
                        continue

                    if method == "_result":
                        if len(args) > 0:
                            result = args[0]
                        else:
                            result = None

                        self._invoke_results[transaction_id_] = result
                    else:
                        handler = self._invoke_handlers.get(method)
                        if handler:
                            res = handler(*args)
                            if res is not None:
                                self.call("_result", res,
                                          transaction_id=transaction_id_)

                        if method == invoked_method:
                            self._invoke_args[invoked_method] = args
                            break

                    if transaction_id_ == 1.0:
                        self._connect_result = packet
                    else:
                        self.handle_packet(packet)
                else:
                    self.handle_packet(packet)

            if transaction_id:
                result = self._invoke_results.pop(transaction_id, None)

                return result

            if invoked_method:
                args = self._invoke_args.pop(invoked_method, None)

                return args
dataset/ETHPy150Open chrippa/livestreamer/src/livestreamer/plugins/ustreamtv.py/FlashmediaRTMP.process_packets/swapped operands of `not in`