r"""Return the next *n* rows as a list of :class:`Record` objects.

        :param float timeout: Optional timeout value in seconds.

        :return: A list of :class:`Record` instances.
492748
async def fetch(self, n, *, timeout=None):
        
        """
        self._check_ready()
        if n <= 0:
            raise exceptions.InterfaceError('n must be greater than zero')
        if self._exhausted:
            return []
        recs = await self._exec(n, timeout)
        if len(recs) < n:
            self._exhausted = True
        return recs
406939
def get(self, timeout=None):
        # type: (float) -> T
        """"""
        self.wait(timeout)
        if isinstance(self._result, Exception):
            raise self._result
        return self._result
1231425
def timeout(self, timeout=None):
        
        if timeout is None:
            return self.__timeout
        if 0 < float(timeout) < 3600:
            self.__timeout = float(timeout)
            return self.__timeout
        else:
            return None
717174
def next(self):
        
        if self._current < len(self._record_list):
            rec = self._record_list[self._current]
            key = rec['name']
            self._current += 1
            return key
        else:
            raise StopIteration
1308486
async def fetchrow(self, *, timeout=None):
        
        """
        self._check_ready()
        if self._exhausted:
            return None
        recs = await self._exec(1, timeout)
        if len(recs) < 1:
            self._exhausted = True
            return None
        return recs[0]
1039944
def _next_page(self, offset):
        """"""
        self._log.debug("Iterator c_record={}".format(self.c_record))
        page_size = self.page_size
        if (offset + page_size) > self.max_records:
            page_size = self.max_records - offset
        param_dict = self.query_dict.copy()
        param_dict.update(
            {
                'start': str(offset),
                'rows': str(page_size),
                'explainOther': '',
                'hl.fl': '',
            }
        )
        self.res = self.client.search(**param_dict)
        self._num_hits = int(self.res['response']['numFound'])
352517
def _get_next_buffered_row(self):
        
        if self._iter_row == self._iter_nrows:
            raise StopIteration

        if self._row_buffer_index >= self._iter_row_buffer:
            self._buffer_iter_rows(self._iter_row)

        data = self._row_buffer[self._row_buffer_index]
        self._iter_row += 1
        self._row_buffer_index += 1
        return data
1050352
def grab_earliest(self, timeout: float=None) -> typing.List[DataAndMetadata.DataAndMetadata]:
        """"""
        timeout = timeout if timeout is not None else 10.0
        with self.__buffer_lock:
            if len(self.__buffer) == 0:
                done_event = threading.Event()
                self.__done_events.append(done_event)
                self.__buffer_lock.release()
                done = done_event.wait(timeout)
                self.__buffer_lock.acquire()
                if not done:
                    raise Exception("Could not grab latest.")
            return self.__buffer.pop(0)
872086
def next(self, rows: List[Row]) -> List[Row]:
        
        if not rows:
            return []
        input_row_index = self._get_row_index(rows[0])
        if input_row_index < len(self.table_data) - 1 and input_row_index != -1:
            return [self.table_data[input_row_index + 1]]
        return []
630802
def iterRecords(self):
        """"""
        if self.numRecords is None:
            self.__dbfHeader()
        f = self.__getFileObj(self.dbf)
        f.seek(self.__dbfHdrLength)
        for i in xrange(self.numRecords):
            r = self.__record()
            if r:
                yield r
1000443
def records(self):
        """"""
        return ModelList(*[r for sent in self.sentences for r in sent.records])
454409
def previous(self, rows: List[Row]) -> List[Row]:
        
        if not rows:
            return []
        input_row_index = self._get_row_index(rows[0])
        if input_row_index > 0:
            return [self.table_data[input_row_index - 1]]
        return []
190445
def get_next(self):
        """"""
        return self.loop_time + (self.croniter.get_next(float) - self.time)
290277
def bpopright(self, timeout=0):
        
        ret = self.database.blpop(self.key, timeout)
        if ret is not None:
            return ret[1]
160547
def next_row(self):
        """"""
        row = self.currentIndex().row()
        rows = self.source_model.rowCount()
        if row + 1 == rows:
            row = -1
        self.selectRow(row + 1)
544133
def iter_rows(self):
        
        fileobj = self._fileobj
        cls_row = self.cls_row
        fields = self.fields

        for idx in range(self.prolog.records_count):
            data = fileobj.read(1)

            marker = struct.unpack('<1s', data)[0]
            is_deleted = marker == b'*'

            if is_deleted:
                continue

            row_values = []
            for field in fields:
                val = field.cast(fileobj.read(field.len))
                row_values.append(val)

            yield cls_row(*row_values)
406096
async def fetchrow(self, *args, timeout=None):
        
        data = await self.__bind_execute(args, 1, timeout)
        if not data:
            return None
        return data[0]