code: def decode(s):
      
      if isinstance(s, binary_type):
          s = s.decode('latin-1')
      if not isinstance(s, text_type):
          return s
  
      r = []
      _in = []
      for c in s:
          if c == '&' and not _in:
              _in.append('&')
          elif c == '-' and _in:
              if len(_in) == 1:
                  r.append('&')
              else:
                  r.append(modified_deutf7(''.join(_in[1:])))
              _in = []
          elif _in:
              _in.append(c)
          else:
              r.append(c)
      if _in:
          r.append(modified_deutf7(''.join(_in[1:])))
  
      return ''.join(r)
docs: Decode a folder name from IMAP modified UTF-7 encoding to unicode.
  
      Despite the function's name, the input may still be a unicode
      string. If the input is bytes, it's first decoded to unicode.