human
Complete this python program:
def decode_mailbox_name(name):
assistant
#Here is the Python program you requested.

    """Decodes a modified UTF-7 mailbox name.
    If the string cannot be decoded, it is returned unmodified.
    See RFC 3501, sec. 5.1.3.
    Arguments:
    - name: string, possibly encoded with modified UTF-7
    Returns: decoded UTF-8 string.
    """
    def demodify(m):
        s = m.group()
        if (s == '+'):
            return '+-'
        return (('+' + s[1:(-1)].replace(',', '/')) + '-')
    ret = MUTF7_SHIFT_RE.sub(demodify, name)
    try:
        return ret.decode('utf-7').encode('utf-8')
    except (UnicodeDecodeError, UnicodeEncodeError):
        return name