<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def indexbox(msg="Shall I continue?", title=" ", choices=("Yes", "No"), image=None, default_choice='Yes', cancel_choice='No'):
 """ Display a buttonbox with the specified choices. :param str msg: the msg to be displayed :param str title: the window title :param list choices: a list or tuple of the choices to be displayed :param str image: Filename of image to display :param str default_choice: The choice you want highlighted when the gui appears :param str cancel_choice: If the user presses the 'X' close, which button should be pressed :return: the index of the choice selected, starting from 0 """

    reply = bb.buttonbox(msg=msg,
                         title=title,
                         choices=choices,
                         image=image,
                         default_choice=default_choice,
                         cancel_choice=cancel_choice)
    if reply is None:
        return None
    for i, choice in enumerate(choices):
        if reply == choice:
            return i
    msg = ("There is a program logic error in the EasyGui code "
           "for indexbox.\nreply={0}, choices={1}".format(
               reply, choices))
    raise AssertionError(msg)