Given `docs` and `aggregations` return a single document with the
    aggregations applied.

def make_aggregate(docs, aggregations):
    """
    Given `docs` and `aggregations` return a single document with the
    aggregations applied.
    """
    new_doc = dict(docs[0])

    for keyname, aggregation_function in aggregations:
        new_doc[keyname] = aggregation_function(docs)

    return new_doc