def values_to_slice(
        values,
        value1,
        value2):
    min_value, max_value = (value1, value2) if value1 <= value2 else \
        (value2, value1)
    assert min_value <= max_value
    start_index = -1
    end_index = -1

    if len(values) > 0:
        if values[0] <= values[-1]:
            # Increasing values.
            start_value = clamp(values[0], values[-1], min_value)
            end_value = clamp(values[0], values[-1], max_value)
        else:
            # Decreasing values.
            start_value = clamp(values[-1], values[0], max_value)
            end_value = clamp(values[-1], values[0], min_value)

        start_index = start_index_of_value_in_range(start_value, values)
        end_index = end_index_of_value_in_range(end_value, values)

        assert start_index >= 0 and start_index <= len(values)
        assert end_index >= 0 and end_index <= len(values)

    return (start_index, end_index)
Return slice indices corresponding to the location of *value1* and
dataset/ETHPy150Open Esri/solutions-geoprocessing-toolbox/suitability/toolboxes/scripts/MultidimensionSupplementalTools/MultidimensionSupplementalTools/Scripts/mds/math.py/values_to_slice