def get_async(self, urls, callback):
        def get(url, headers):
            resp = requests.get(url, headers=headers)
            if resp:
                si = self.process_response(resp)
                callback(si, resp.url)

        @asyncio.coroutine
        def run(urls, concurrency, loop):
            urls = list(urls)
            pending = [loop.run_in_executor(None, get, url, self.headers) for url in urls[:concurrency]]
            rest = urls[concurrency:]
            while pending:
                done, pending = yield asyncio.From(asyncio.wait(pending, return_when=asyncio.FIRST_COMPLETED))
                while rest and concurrency < len(pending):
                    pending.add(loop.run_in_executor(None, get, rest.pop(), self.headers))
                for future in done:
                    try:
                        si = future.result()
                        # callback(si, si.original_url)
                    except Exception:
                        logger.info('failed on url', exc_info=True)

        loop = asyncio.get_event_loop()
        # TODO: make magic concurrency number a parameter
        loop.run_until_complete(run(urls, concurrency=32, loop=loop))
dataset/ETHPy150Open dossier/dossier.models/dossier/models/openquery/fetcher.py/Fetcher.get_async/swapped operands of `<`