def consolidateBy(requestContext, seriesList, consolidationFunc):
    for series in seriesList:
        # datalib will throw an exception, so it's not necessary to validate
        # here
        series.consolidationFunc = consolidationFunc
        series.name = 'consolidateBy(%s,"%s")' % (series.name,
                                                  series.consolidationFunc)
        series.pathExpression = series.name
    return seriesList
Takes one metric or a wildcard seriesList and a consolidation function
dataset/ETHPy150Open brutasse/graphite-api/graphite_api/functions.py/consolidateBy