human
Complete this python program:
def aggregate():
assistant
#Here is the Python program you requested.

    """REST Controller
    """
    def clear_aggregates(r, **attr):
        if (not s3_has_role(ADMIN)):
            auth.permission.fail()
        s3db.stats_demographic_rebuild_all_aggregates()
        redirect(URL(c='vulnerability', f='aggregate', args=''))
    s3db.set_method('vulnerability', 'aggregate', method='clear', action=vulnerability_rebuild_all_aggregates)
    output = s3_rest_controller()
    return output