def _find_indicies(array, value):
    """
    Finds the indicies of the array elements that are the closest to `value`. If
    value is present in `array` then the two indicies are the same.

    Parameters
    ----------
    value : scalar
        Value of which the index is to be found.
    array : list/numpy.ndarray
        Sorted array.

    Raises
    ------
    ValueError
        Raised if the indices are not found (i.e. the eindicies are out of bound
        of the array)

    Returns
    -------
    int, int
        Returns the indicies of the elements of the array most close to value.
        If the vlaue is present in the array then the function returns the same
        int twice.

    """

    for i, elem in enumerate(array):
        if value == elem:
            return i, i
        elif elem < value and value < array[i+1]:
            return i, i+1

    raise ValueError("Indicies not found.")