'Scans for stored records.
Scans through the collection, returning stored values ordered by timestamp.
Args:
after_timestamp: If set, only returns values recorded after timestamp.
include_suffix: If true, the timestamps returned are pairs of the form
(micros_since_epoc, suffix) where suffix is a 24 bit random refinement
to avoid collisions. Otherwise only micros_since_epoc is returned.
max_records: The maximum number of records to return. Defaults to
unlimited.
Yields:
Pairs (timestamp, rdf_value), indicating that rdf_value was stored at
timestamp.'

def Scan(self, after_timestamp=None, include_suffix=False, max_records=None):

    after_urn = None
    if (after_timestamp is not None):
        if isinstance(after_timestamp, tuple):
            suffix = after_timestamp[1]
            after_timestamp = after_timestamp[0]
        else:
            suffix = self.MAX_SUFFIX
        after_urn = utils.SmartStr(self._MakeURN(self.collection_id, after_timestamp, suffix=suffix))
    for (subject, timestamp, value) in data_store.DB.ScanAttribute(self.collection_id.Add('Results'), self.ATTRIBUTE, after_urn=after_urn, max_records=max_records, token=self.token):
        rdf_value = self.RDF_TYPE.FromSerializedString(value)
        rdf_value.age = timestamp
        if include_suffix:
            (yield (self._ParseURN(subject), rdf_value))
        else:
            (yield (timestamp, rdf_value))
