<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_stats_display_width(self, curse_msg, without_option=False):
 """Return the width of the formatted curses message."""

        try:
            if without_option:
                # Size without options
                c = len(max(''.join([(u(u(nativestr(i['msg'])).encode('ascii', 'replace')) if not i['optional'] else "")
                                     for i in curse_msg['msgdict']]).split('\n'), key=len))
            else:
                # Size with all options
                c = len(max(''.join([u(u(nativestr(i['msg'])).encode('ascii', 'replace'))
                                     for i in curse_msg['msgdict']]).split('\n'), key=len))
        except Exception as e:
            logger.debug('ERROR: Can not compute plugin width ({})'.format(e))
            return 0
        else:
            return c