<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def __WaitForVolume(volume, desired_state):
 """ Blocks until EBS volume is in desired state. """

  print 'Waiting for volume %s to be %s...' % (volume.id, desired_state)
  while True:
    volume.update()
    sys.stdout.write('.')
    sys.stdout.flush()
    #print 'status is: %s' % volume.status
    if volume.status == desired_state:
        break
    time.sleep(5)  
  return