def flagsimap2maildir(flagstring):
 retval = set()
 imapflaglist = flagstring[1:(-1)].split()
 for (imapflag, maildirflag) in flagmap:
  if (imapflag in imapflaglist):
   retval.add(maildirflag)
 return retval

def flagsimap2maildir ( flagstring ) : retval = set ( ) imapflaglist = flagstring [ 1 : ( - 1 ) ] . split ( ) for ( imapflag , maildirflag ) in flagmap : if ( imapflag in imapflaglist ) : retval . add ( maildirflag ) return retval
convert string into a flags set .