def index_before(self, x):
    leftidx = (bisect(self.points, (x, None)) - 1)
    if (leftidx < 0):
        return None
    return leftidx
def index_before(self, x):
    leftidx = (bisect(self.points, (x, None)) - 1)
    if (leftidx < 0):
        return None
    return leftidx