def GetAttributes(self, urns, ignore_cache=False, token=None,
                    age=NEWEST_TIME):
    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 KeyError:
          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
Test assertWarns on a warning filterd by default.
dataset/ETHPy150Open google/grr/grr/lib/aff4.py/Factory.GetAttributes--crossover with--dataset/ETHPy150Open nlloyd/SubliminalCollaborator/libs/twisted/trial/test/test_assertions.py/WarningAssertionTests.test_assertWarnsFilter