def count(self):
        """Count of all results, preserving aggregate grouping."""
        self._execute('SELECT count(*) from (%s) as q' % self.as_sql())
        return self._cursor.fetchone()[0]
dataset/ETHPy150Open mozilla/addons-server/src/olympia/editors/sql_model.py/RawSQLManager.count/original