def METHOD_NAME(input: Store, num_bins: int) -> Store:
    """
    Counts the occurrences of each bin index
    Parameters
    ----------
    input : Store
        Input to bin-count
    num_bins : int
        Number of bins
    Returns
    -------
    Store
        Counting result
    """
    result = context.create_store(ty.uint64, (num_bins,))
    np.asarray(result).fill(0)
    task = context.create_auto_task(OpCode.BINCOUNT)
    task.add_input(input)
    # Broadcast the result store. This commands the Legate runtime to give
    # the entire store to every task instantiated by this task descriptor
    task.add_broadcast(result)
    # Declares that the tasks will do reductions to the result store and
    # that outputs from the tasks should be combined by addition
    task.add_reduction(result, ty.ReductionOp.ADD)
    task.execute()
    return result