from __future__ import absolute_import, print_function, unicode_literals


def term(name, field, size=None):
    agg = {
        "name": name,
        "term": {"field": field}
    }
    if size:
        agg["term"]["size"] = size
    return agg


def percentile(name, field, percents=[1, 5, 25, 50, 75, 95, 99]):
    return {
        "name": name,
        "percentile": {
            "field": field, "percents": percents
        }
    }


def histogram(name, field, interval):
    return {
        "name": name,
        "histogram": {
            "field": field, "interval": interval
        }
    }

e70a47fe9737dce9ec5dc48fb2bf0bd22cc79ca6
<mask token>

<mask token>


def term(name, field, size=None):
    agg = {'name': name, 'term': {'field': field}}
    if size:
        agg['term']['size'] = size
    return agg


def percentile(name, field, percents=[1, 5, 25, 50, 75, 95, 99]):
    return {'name': name, 'percentile': {'field': field, 'percents': percents}}


<mask token>

<mask token>


def term(name, field, size=None):
    agg = {'name': name, 'term': {'field': field}}
    if size:
        agg['term']['size'] = size
    return agg


def percentile(name, field, percents=[1, 5, 25, 50, 75, 95, 99]):
    return {'name': name, 'percentile': {'field': field, 'percents': percents}}


def histogram(name, field, interval):
    return {'name': name, 'histogram': {'field': field, 'interval': interval}}

from __future__ import absolute_import, print_function, unicode_literals


def term(name, field, size=None):
    agg = {'name': name, 'term': {'field': field}}
    if size:
        agg['term']['size'] = size
    return agg


def percentile(name, field, percents=[1, 5, 25, 50, 75, 95, 99]):
    return {'name': name, 'percentile': {'field': field, 'percents': percents}}


def histogram(name, field, interval):
    return {'name': name, 'histogram': {'field': field, 'interval': interval}}

from __future__ import absolute_import, print_function, unicode_literals


def term(name, field, size=None):
    agg = {
        "name": name,
        "term": {"field": field}
    }
    if size:
        agg["term"]["size"] = size
    return agg


def percentile(name, field, percents=[1, 5, 25, 50, 75, 95, 99]):
    return {
        "name": name,
        "percentile": {
            "field": field, "percents": percents
        }
    }


def histogram(name, field, interval):
    return {
        "name": name,
        "histogram": {
            "field": field, "interval": interval
        }
    }
