def METHOD_NAME(arr, max_buckets):
    max_value = max(arr) if len(arr) >= 1 else None
    min_value = min(arr) if len(arr) >= 1 else None
    buckets, bucket_interval = build_buckets(min_value, max_value, max_buckets)
    if bucket_interval == 0:
        return
    bins = [b['min_value'] for b in buckets] + [buckets[-1]['max_value']]
    count, _ = np.histogram(arr, bins=bins)
    x = []
    y = []
    for idx, bucket in enumerate(buckets):
        x.append(dict(
            max=bucket['max_value'],
            min=bucket['min_value'],
        ))
        y.append(dict(value=count[idx]))
    return dict(
        x=x,
        y=y,
    )