def send_tcp(self, messages, callback):
        """return the ids of the requests that we sent"""
        out = ''
        ids = []
        for m in messages:
            method, params = m 
            request = json.dumps( { 'id':self.message_id, 'method':method, 'params':params } )
            self.unanswered_requests[self.message_id] = method, params, callback
            ids.append(self.message_id)
            if self.debug:
                print "-->", request
            self.message_id += 1
            out += request + '\n'
        while out:
            try:
                sent = self.s.send( out )
                out = out[sent:]
            except socket.error,e:
                if (errno.EWOULDBLOCK,errno.EAGAIN) in e[0]:
                    print_error( "EAGAIN: retrying")
                    time.sleep(0.1)
                    continue
                else:
                    traceback.print_exc(file=sys.stdout)
                    # this happens when we get disconnected
                    print_error( "Not connected, cannot send" )
                    return None
        return ids
dataset/ETHPy150Open bitxbay/BitXBay/electru/build/lib/electrum/interface.py/Interface.send_tcp/swapped operands of `in`