def query(self, queries):
        changes = []
        sortkey = ''
        done = False
        offset = 0
        while not done:
            query = '&'.join(queries)
            # We don't actually want to limit to 500, but that's the server-side default, and
            # if we don't specify this, we won't get a _more_changes flag.
            q = 'changes/?n=500%s&%s' % (sortkey, query)
            self.log.debug('Query: %s' % (q,))
            responses = self.get(q)
            if len(queries) == 1:
                responses = [responses]
            done = True
            for batch in responses:
                changes += batch
                if batch and '_more_changes' in batch[-1]:
                    done = False
                    if batch[-1] in '_sortkey':
                        sortkey = '&N=%s' % (batch[-1]['_sortkey'],)
                    else:
                        offset += len(batch)
                        sortkey = '&start=%s' % (offset,)
        return changes
dataset/ETHPy150Open openstack/gertty/gertty/sync.py/Sync.query/swapped operands of `in`