def METHOD_NAME(grids, threads):
    if grids > threads:
        return
    grids = threads = 10
    x = np.array([-1, -2, 0.5, 1.5, 4.5, 5], dtype='f8')
    bins = 5
    binner = vaex.superagg.BinnerScalar_float64('x', 0, 5, bins)
    binner.set_data(x)
    grid = vaex.superagg.Grid([binner])
    agg = vaex.superagg.AggCount_float64(grid, grids, grids)
    def bin(thread_index, _ignore):
        grid.bin(thread_index, [agg])
    pool = mt.ThreadPoolIndex(threads)
    list(pool.map(bin, range(100), 100))
    agg_data = agg.get_result()
    expected = (np.array([0, 2, 1, 1, 0, 0, 1, 1]) * 100)
    assert agg_data.tolist() == expected.tolist()
    grid = vaex.superagg.Grid([])
    agg = vaex.superagg.AggCount_float64(grid, grids, grids)
    def bin(thread_index, _ignore):
        grid.bin(thread_index, [agg], len(x))
    pool = mt.ThreadPoolIndex(threads)
    list(pool.map(bin, range(100), 100))
    agg_data = agg.get_result()
    expected = expected.sum()
    assert agg_data.tolist() == expected.tolist()