def _rand_with_seed(x, rand_obj):
    # if rand_obj.state is not a safe integer, Math.sin will return the same
    # result for consecutive values : use the rest of division by 360
    degrees = rand_obj._state % 360
    x = window.Math.sin(degrees/(2*window.Math.PI)) * 10000
    # Adding 1 is not reliable because of current integer implementation
    # If rand_obj._state is not a "safe integer" in the range [-2**53, 2**53]
    # the increment between 2 different values is a power of 2
    # It is stored in an attribute of rand_obj to avoid having to compute it
    # for each iteration
    if not hasattr(rand_obj, 'incr'):
        rand_obj.incr = 1
    rand_obj._state += rand_obj.incr
    return x - window.Math.floor(x)
dataset/ETHPy150Open amrdraz/kodr/app/brython/www/src/Lib/_random.py/_rand_with_seed/original