async def _collect_sample(self, url, url_pattern):
samples = []<EOL>urls = [self.path_generator.generate_url(url, url_pattern) for _ in range(self.confirmation_factor)]<EOL>iterator = asyncio.as_completed([self._fetch_sample(url) for url in urls])<EOL>for promise in iterator:<EOL><INDENT>try:<EOL><INDENT>sig = await promise<EOL>if sig:<EOL><INDENT>samples.append(sig)<EOL><DEDENT><DEDENT>except RejectRequest as e:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>if not samples:<EOL><INDENT>raise StopRequest("<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>return samples<EOL><DEDENT>
Sample collection is meant to be very tolerant to generic failures as failing to
obtain the sample has important consequences on the results.

- Multiple retries with longer delays
- Larger than usual timeout