Process STDOUT and STDERR is being redirected to /tmp/raylogs/.
Waiting for redis server at 127.0.0.1:54009 to respond...
Waiting for redis server at 127.0.0.1:35671 to respond...
Starting local scheduler with the following resources: {'CPU': 12, 'GPU': 1}.
======================================================================
View the web UI at http://localhost:8889/notebooks/ray_ui42527.ipynb?token=0dd1665c2947364adbea56de5f963f965adaf061914f0629
======================================================================

# This function is a proxy for a more interesting and computationally# intensive function.defslow_function(i):time.sleep(1)returni

# Sleep a little to improve the accuracy of the timing measurements below.# We do this because workers may still be starting up in the background.time.sleep(2.0)start_time=time.time()results=[slow_function(i)foriinrange(4)]end_time=time.time()duration=end_time-start_timeprint('The results are {}. This took {} seconds. Run the next cell to see ''if the exercise was done correctly.'.format(results,duration))

The results are [0, 1, 2, 3]. This took 4.004942417144775 seconds. Run the next cell to see if the exercise was done correctly.

@ray.remotedeff(i):time.sleep(1)returni

# Sleep a little to improve the accuracy of the timing measurements below.# We do this because workers may still be starting up in the background.time.sleep(2.0)start_time=time.time()results=ray.get([f.remote(i)foriinrange(4)])end_time=time.time()duration=end_time-start_timeprint('The results are {}. This took {} seconds. Run the next cell to see ''if the exercise was done correctly.'.format(results,duration))

The results are [0, 1, 2, 3]. This took 1.0047783851623535 seconds. Run the next cell to see if the exercise was done correctly.

assertresults==[0,1,2,3],'Did you remember to call ray.get?'assertduration<1.1,('The loop took {} seconds. This is too slow.'.format(duration))assertduration>1,('The loop took {} seconds. This is too fast.'.format(duration))print('Success! The example took {} seconds.'.format(duration))