<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def message_box(type, title, message, icon=None, buttons=QMessageBox.Ok, custom_buttons=None):
 """ Provides a fast GUI message box. :param title: Current message title. :type title: unicode :param message: Message. :type message: unicode :param icon: Custom icon. :type icon: QConstant :param buttons: Standard buttons. :type buttons: QConstant :param custom_buttons: Custom buttons. :type custom_buttons: tuple or list :return: User choice. :rtype: int """


    LOGGER.debug("> Launching messagebox().")
    LOGGER.debug("> Message type: '{0}'.".format(type))
    LOGGER.debug("> Title: '{0}'.".format(title))
    LOGGER.debug("> Message: '{0}'.".format(message))

    message_box = QMessageBox()
    message_box.setWindowTitle("{0} | {1}".format(Constants.application_name, title))
    message_box.setText(message)

    for button, role in custom_buttons or ():
        message_box.addButton(button, role)
    umbra.ui.common.set_children_padding(message_box, (QPushButton,), width=12)

    message = message.split("\n")
    if type == "Critical":
        if icon:
            message_box.setIcon(icon)
        else:
            message_box.setIcon(QMessageBox.Critical)
        for line in message:
            LOGGER.critical("!> {0}".format(line))
    elif type == "Error":
        if icon:
            message_box.setIcon(icon)
        else:
            message_box.setIcon(QMessageBox.Critical)
        for line in message:
            LOGGER.error("!> {0}".format(line))
    elif type == "Detailed Error":
        if icon:
            message_box.setIcon(icon)
        else:
            message_box.setIcon(QMessageBox.Critical)
        RuntimeGlobals.logging_session_handler_stream and \
        message_box.setDetailedText("".join(RuntimeGlobals.logging_session_handler_stream.stream))
        text_edit = message_box.findChild(QTextEdit)
        if text_edit:
            text_edit.setCurrentFont(QFont("Courier"))
            text_edit.setLineWrapMode(QTextEdit.NoWrap)
            text_edit.moveCursor(QTextCursor.End)
            text_edit.ensureCursorVisible()
        for line in message:
            LOGGER.error("!> {0}".format(line))
    elif type == "Warning":
        if icon:
            message_box.setIcon(icon)
        else:
            message_box.setIcon(QMessageBox.Warning)
        for line in message:
            LOGGER.warning("{0}".format(line))
    elif type == "Information":
        if icon:
            message_box.setIcon(icon)
        else:
            message_box.setIcon(QMessageBox.Information)
        for line in message:
            LOGGER.info("{0}".format(line))
    elif type == "Question":
        if icon:
            message_box.setIcon(icon)
        else:
            message_box.setIcon(QMessageBox.Question)
        for line in message:
            LOGGER.info("{0}".format(line))

    message_box.setStandardButtons(buttons)
    message_box.setWindowFlags(Qt.WindowStaysOnTopHint)
    message_box.show()
    foundations.ui.common.center_widget_on_screen(message_box)
    return message_box.exec_()