def predict_state(values, platform, value_range=None):
    if value_range is None:
        if platform == "windows":
            return foresight.msvc.rand.predict_state(values)
        elif platform == "linux":
            return foresight.glibc.random.predict_state(values)
    else:
        tmax = _platform_tmax(platform)
        min = value_range[0]
        max = value_range[1]
        init = int((min - values[0]) * (tmax + 1.0) / (max - min + 1.0))
        operation = lambda x: rand_range(x, min, max, tmax)

        if platform == "windows":
            for i in range(2**ceil(16 - log(max - min, 2))):
                for lower in range(2**16):
                    num = (init << 16) | lower
                    state = lcg.verify_candidate(num, values[1:], a=214013,
                                                 c=2531011, m=2**31,
                                                 masked_bits=16,
                                                 operation=operation)
                    if state is not None:
                        return state
                init += 1
        elif platform == "linux":
            raise NotImplementedError("Linux PHP bounded rand is not yet supported")
dataset/ETHPy150Open ALSchwalm/foresight/foresight/php/rand.py/predict_state/swapped operands of `-`