def _wait_for_futures(self, futures):
        """Block until all futures complete. If any fail, raise the encountered exception.

        Arguments:
            futures: A list of Future objects awaiting results.

        Raises:
            The first encountered exception if a future fails.
        """
        while not all(future.succeeded() for future in futures):
            for future in futures:
                self._client.poll(future=future)

                if future.failed():
                    raise future.exception  # pylint: disable-msg=raising-bad-type
Block until all futures complete. If any fail, raise the encountered exception.

        Arguments:
            futures: A list of Future objects awaiting results.

        Raises:
            The first encountered exception if a future fails.
        
kafka/admin/client.py