def METHOD_NAME(self, builderid, buildid=None, stepid=None, complete=None,
                      result_spec=None):
    def thd(conn):
        sets_table = self.db.model.test_result_sets
        q = sets_table.select().where(sets_table.c.builderid == builderid)
        if buildid is not None:
            q = q.where(sets_table.c.buildid == buildid)
        if stepid is not None:
            q = q.where(sets_table.c.stepid == stepid)
        if complete is not None:
            q = q.where(sets_table.c.complete == (1 if complete else 0))
        if result_spec is not None:
            return result_spec.thd_execute(conn, q, lambda x: self._thd_row2dict(conn, x))
        res = conn.execute(q)
        return [self._thd_row2dict(conn, row) for row in res.fetchall()]
    res = yield self.db.pool.do(thd)
    return res