def GetAttributes(self, urns, ignore_cache=False, token=None,
                    age=NEWEST_TIME):
    """Retrieves all the attributes for all the urns."""
    urns = set([utils.SmartUnicode(u) for u in urns])
    if not ignore_cache:
      for subject in list(urns):
        key = self._MakeCacheInvariant(subject, token, age)

        try:
          yield subject, self.cache.Get(key)
          urns.remove(subject)
        except __HOLE__:
          pass

    # If there are any urns left we get them from the database.
    if urns:
      for subject, values in data_store.DB.MultiResolvePrefix(
          urns, AFF4_PREFIXES, timestamp=self.ParseAgeSpecification(age),
          token=token, limit=None):

        # Ensure the values are sorted.
        values.sort(key=lambda x: x[-1], reverse=True)

        key = self._MakeCacheInvariant(subject, token, age)
        self.cache.Put(key, values)

        yield utils.SmartUnicode(subject), values
dataset/ETHPy150Open google/grr/grr/lib/aff4.py/Factory.GetAttributes