def wait_for_instance_deletion(credentials, project, zone, instance_name,<EOL>interval_seconds=<NUM_LIT:5>):
t0 = time.time()<EOL>access_token = credentials.get_access_token()<EOL>headers = {<EOL>'<STR_LIT>': '<STR_LIT>' % access_token.access_token<EOL>}<EOL>r = requests.get('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>% (project, zone, instance_name),<EOL>headers=headers)<EOL>if r.status_code == <NUM_LIT>:<EOL><INDENT>raise AssertionError('<STR_LIT>' % instance_name)<EOL><DEDENT>r.raise_for_status()<EOL>_LOGGER.debug('<STR_LIT>', instance_name)<EOL>while True:<EOL><INDENT>time.sleep(interval_seconds)<EOL>access_token = credentials.get_access_token()<EOL>headers = {<EOL>'<STR_LIT>': '<STR_LIT>' % access_token.access_token<EOL>}<EOL>r = requests.get('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>% (project, zone, instance_name),<EOL>headers=headers)<EOL>if r.status_code == <NUM_LIT>:<EOL><INDENT>break<EOL><DEDENT>r.raise_for_status()<EOL>_LOGGER.debug('<STR_LIT>', instance_name)<EOL><DEDENT>t1 = time.time()<EOL>t = t1-t0<EOL>t_min = t/<NUM_LIT><EOL>_LOGGER.info('<STR_LIT>', t, t_min)<EOL>
Wait until an instance is deleted.

    We require that initially, the specified instance exists.
    TODO: docstring