<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def aggregate(name):
 """ Perform an aggregation request. """

    cube = get_cube(name)
    result = cube.aggregate(aggregates=request.args.get('aggregates'),
                            drilldowns=request.args.get('drilldown'),
                            cuts=request.args.get('cut'),
                            order=request.args.get('order'),
                            page=request.args.get('page'),
                            page_size=request.args.get('pagesize'))
    result['status'] = 'ok'

    if request.args.get('format', '').lower() == 'csv':
        return create_csv_response(result['cells'])
    else:
        return jsonify(result)