class_docstr: A set of excellent Records from a query.
class_docstr_tok: ["A","set","of","excellent","Records","from","a","query","."]
docstr: Iterate over all rows, consuming the underlying generator
  only when necessary.
docstr_tok: ["Iterate","over","all","rows",",","consuming","the","underlying","generator","only","when","necessary","."]
code: def __iter__(self):
      """Iterate over all rows, consuming the underlying generator
      only when necessary."""
      i = 0
      while True:
          # Other code may have iterated between yields,
          # so always check the cache.
          if i < len(self):
              yield self[i]
          else:
              # Throws StopIteration when done.
              # Prevent StopIteration bubbling from generator, following https://www.python.org/dev/peps/pep-0479/
              try:
                  yield next(self)
              except StopIteration:
                  return
          i += 1
  
imports: import os
  from sys import stdout
  from collections import OrderedDict
  from contextlib import contextmanager
  from inspect import isclass
  import tablib
  from docopt import docopt
  from sqlalchemy import create_engine, exc, inspect, text
label_desc: Use image node_id 3 for calling the RecordCollection obj's underlying member method code with example usage: obj.__iter__() without return types