Find rightmost value less than or equal to x.

    :type array: list
    :param array: an iterable object that support inex

    :param x: a comparable value

    Example::

        >>> find_le([0, 1, 2, 3], 2.0)
        2

    **中文文档**

    寻找最大的小于等于x的数。
775145
def find_le(array, x):
    
    i = bisect.bisect_right(array, x)
    if i:
        return array[i - 1]
    raise ValueError
244377
public static int search(short[] shortArray, short value) { 
        int start = 0;
        int end = shortArray.length - 1;
        int middle = 0;
        
        while(start <= end) {
            middle = (start + end) >> 1;
        
            if(value == shortArray[middle]) {
                return middle;
            }
            
            if(value < shortArray[middle]) {
                end = middle - 1 ;
            }
            else {
                start = middle + 1;
            }
        }
                

        return -1;
    }
1351138
def search_greater(values, target):
    
    first = 0
    last = len(values)

    while first < last:
        middle = (first + last) // 2
        if values[middle][0] < target:
            first = middle + 1
        else:
            last = middle

    return first
1050829
def find_indices(lst, element):
    
    result = []
    offset = -1
    while True:
        try:
            offset = lst.index(element, offset+1)
        except ValueError:
            return result
        result.append(offset)
663440
def _findNearest(arr, value):
    
    arr = np.array(arr)
    # find nearest value in array
    idx = (abs(arr-value)).argmin()
    return arr[idx]
1021971
def find_lt(array, x):
    
    i = bisect.bisect_left(array, x)
    if i:
        return array[i - 1]
    raise ValueError
394239
function searchArray(list, value) {
  var index = list.indexOf(value);

  if (index === -1) return false;
  return value;
}
85245
def bisect_index(a, x):
    
    i = bisect.bisect_left(a, x)
    if i != len(a) and a[i] == x:
        return i
    raise ValueError
949517
def open01(x, limit=1.e-6):
    """"""
    try:
        return np.array([min(max(y, limit), 1. - limit) for y in x])
    except TypeError:
        return min(max(x, limit), 1. - limit)
617621
def array_values(expr):
    """"""
    if isinstance(expr, Array):
        return expr.get_elems(all_subs(expr._bounds))
    elif isinstance(expr, list):
        vals = [array_values(x) for x in expr]
        return flatten(vals)
    else:
        return [expr]
1272407
def lx(mt, x):
        
    if x < len(mt.lx):
        return mt.lx[x]
    else:
        return 0
1293483
function findIndex (array, predicate) {
  for (let i = 0; i < array.length; i++) {
    if (predicate(array[i])) return i
  }
  return -1
}
467206
function findIndexInArray(array, callback) {
        var _length = array.length;
        for (var i = 0; i < _length; i++) {
            if (callback(array[i])) return i;
        }
        return -1;
    }
536132
function findNext(array, item) {
  return array[(Util.findIndex(array, el => el === item) + 1) % array.length]
}
1049463
function (items) {
                var
                    idx;
                idx = items.length;
                while (idx--) {
                    if (0 !== items[idx].min()) {
                        ++idx;
                        break;
                    }
                }
                return idx;
            }
576750
def p_array_index(self, p):
        ''''''
        if len(p) == 3:
            p[0] = slice(0, -1, -1)
        elif len(p) == 1 or p[1] == ':':
            p[0] = slice(0, -1, 1)
        else:
            p[0] = slice(0, int(p[1]), 1)
1142265
public static int lastIndexOf(double[] array, double val) {
        for (int i=array.length-1; i >= 0; i--) {
            if (array[i] == val) {
                return i;
            }
        }
        return -1;
    }