def populate(self, max_wait=2.0, wait_for_complete=True, query_cl=None):
        attempt = 0
        start = time.time()
        while True:
            time_spent = time.time() - start
            if max_wait is not None and time_spent >= max_wait:
                raise TraceUnavailable(
                    "Trace information was not available within %f seconds. Consider raising Session.max_trace_wait." % (max_wait,))

            log.debug("Attempting to fetch trace info for trace ID: %s", self.trace_id)
            session_results = self._execute(
                SimpleStatement(self._SELECT_SESSIONS_FORMAT, consistency_level=query_cl), (self.trace_id,), time_spent, max_wait)

            is_complete = session_results and session_results[0].duration is not None
            if not session_results or (wait_for_complete and not is_complete):
                time.sleep(self._BASE_RETRY_SLEEP * (2 ** attempt))
                attempt += 1
                continue
            if is_complete:
                log.debug("Fetched trace info for trace ID: %s", self.trace_id)
            else:
                log.debug("Fetching parital trace info for trace ID: %s", self.trace_id)

            session_row = session_results[0]
            self.request_type = session_row.request
            self.duration = timedelta(microseconds=session_row.duration) if is_complete else None
            self.started_at = session_row.started_at
            self.coordinator = session_row.coordinator
            self.parameters = session_row.parameters
            # since C* 2.2
            self.client = getattr(session_row, 'client', None)

            log.debug("Attempting to fetch trace events for trace ID: %s", self.trace_id)
            time_spent = time.time() - start
            event_results = self._execute(
                SimpleStatement(self._SELECT_EVENTS_FORMAT, consistency_level=query_cl), (self.trace_id,), time_spent, max_wait)
            log.debug("Fetched trace events for trace ID: %s", self.trace_id)
            self.events = tuple(TraceEvent(r.activity, r.event_id, r.source, r.source_elapsed, r.thread)
                                for r in event_results)
            break
Return the fully serialized queryset (or None if the output stream is
dataset/ETHPy150Open datastax/python-driver/cassandra/query.py/QueryTrace.populate--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/django/core/serializers/base.py/Serializer.getvalue