def nonzero_indices(arr, max_number=1):
    """get an array of indices that have nonzero value"""
    result = []
    for i in range(len(arr)):
        if arr[i] != 0.0:
            result.append((arr[i], i))
    result = sorted(result, reverse=True)
    n = min(max_number, len(result))
    return [result[_][1] for _ in range(n)]