def _evaluate(self):
if self._elements:<EOL><INDENT>for element in self._elements:<EOL><INDENT>yield element<EOL><DEDENT><DEDENT>else:<EOL><INDENT>for page in itertools.count():<EOL><INDENT>raw_elements = self._retrieve_raw_elements(page)<EOL>for raw_element in raw_elements:<EOL><INDENT>element = self._parse_raw_element(raw_element)<EOL>self._elements.append(element)<EOL>yield element<EOL>if self.__limit and len(self._elements) >= self.__limit:<EOL><INDENT>break<EOL><DEDENT><DEDENT>if any([<EOL>len(raw_elements) < self.page_size,<EOL>(self.__limit and len(self._elements) >= self.__limit)<EOL>]):<EOL><INDENT>break<EOL><DEDENT><DEDENT><DEDENT>
Lazily retrieve and paginate report results and build Record instances from returned data