human
I wrote the below code

    if isinstance(client, images_v1_client.ImagesClient):
        def _show_image_v1(image_id):
            resp = client.check_image(image_id)
            return common_image.get_image_meta_from_headers(resp)
        show_image = _show_image_v1
    else:
        show_image = client.show_image
    current_status = 'An    unknown    status'
    start = int(time.time())
    while ((int(time.time()) - start) < client.build_timeout):
        image = show_image(image_id)
        if ('image' in image):
            image = image['image']
        current_status = image['status']
        if (current_status == status):
            return
        if (current_status.lower() == 'killed'):
            raise exceptions.ImageKilledException(image_id=image_id, status=status)
        if (current_status.lower() == 'error'):
            raise exceptions.AddImageException(image_id=image_id)
        time.sleep(client.build_interval)
    message = ('Image    %(image_id)s    failed    to    reach    %(status)s    state    (current    state    %(current_status)s)    within    the    required    time    (%(timeout)s    s).' % {'image_id': image_id, 'status': status, 'current_status': current_status, 'timeout': client.build_timeout})
    caller = test_utils.find_test_caller()
    if caller:
        message = ('(%s)    %s' % (caller, message))
    raise lib_exc.TimeoutException(message)

What's a good function header?
assistant
#Here's a good function header.

def wait_for_image_status(client, image_id, status):