def ResolvePrefix(self, subject, attribute_prefix, timestamp=None,
                    limit=None, token=None):
    """Resolve all attributes for a subject matching a prefix."""
    self.security_manager.CheckDataStoreAccess(
        token, [subject], self.GetRequiredResolveAccess(attribute_prefix))

    if isinstance(attribute_prefix, str):
      attribute_prefix = [attribute_prefix]

    start, end = self._GetStartEndTimestamp(timestamp)

    # Holds all the attributes which matched. Keys are attribute names, values
    # are lists of timestamped data.
    results = []

    with self.cache.Get(subject) as sqlite_connection:
      for prefix in attribute_prefix:
        nr_results = len(results)
        if limit and limit >= nr_results:
          break
        new_limit = limit
        if new_limit:
          new_limit -= nr_results
        if timestamp == self.NEWEST_TIMESTAMP:
          data = sqlite_connection.GetNewestFromPrefix(subject, prefix,
                                                       new_limit)
          for attribute, value, ts in data:
            value = self._Decode(attribute, value)
            results.append((attribute, value, ts))
        else:
          data = sqlite_connection.GetValuesFromPrefix(subject, prefix, start,
                                                       end, new_limit)
          for attribute, value, ts in data:
            value = self._Decode(attribute, value)
            results.append((attribute, value, ts))

      return results
dataset/ETHPy150Open google/grr/grr/lib/data_stores/sqlite_data_store.py/SqliteDataStore.ResolvePrefix/swapped operands of `>=`