def fetch_tuples(self, max_tuples=<NUM_LIT:20>, timeout=None):
tuples = list()<EOL>if timeout is None:<EOL><INDENT>while len(tuples) < max_tuples:<EOL><INDENT>fetcher = self._data_fetcher<EOL>if not fetcher:<EOL><INDENT>break<EOL><DEDENT>tuples.append(fetcher.items.get())<EOL><DEDENT>return tuples<EOL><DEDENT>timeout = float(timeout)<EOL>end = time.time() + timeout<EOL>while len(tuples) < max_tuples:<EOL><INDENT>qto = end - time.time()<EOL>if qto <= <NUM_LIT:0>:<EOL><INDENT>break<EOL><DEDENT>try:<EOL><INDENT>fetcher = self._data_fetcher<EOL>if not fetcher:<EOL><INDENT>break<EOL><DEDENT>tuples.append(fetcher.items.get(timeout=qto))<EOL><DEDENT>except queue.Empty:<EOL><INDENT>break<EOL><DEDENT><DEDENT>return tuples<EOL>
Fetch a number of tuples from this view.

Fetching of data must have been started with
:py:meth:`start_data_fetch` before calling this method.

If ``timeout`` is ``None`` then the returned list will
contain ``max_tuples`` tuples. Otherwise if the timeout is reached
the list may contain less than ``max_tuples`` tuples.

Args:
    max_tuples(int): Maximum number of tuples to fetch.
    timeout(float): Maximum time to wait for ``max_tuples`` tuples.

Returns:
    list: List of fetched tuples.
.. versionadded:: 1.12