def find_le(a, x):
    """Find rightmost value less than or equal to x."""
    i = bs.bisect_right(a, x)
    if i: return i - 1
    raise ValueError
def find_le ( a , x ) : i = bs . bisect_right ( a , x ) if i : return i - 1 raise ValueError
Find rightmost value less than or equal to x.