code: def from_maildir(self, codes: str) -> FrozenSet[Flag]:
          
          flags = set()
          for code in codes:
              if code == ',':
                  break
              to_sys = self._to_sys.get(code)
              if to_sys is not None:
                  flags.add(to_sys)
              else:
                  to_kwd = self._to_kwd.get(code)
                  if to_kwd is not None:
                      flags.add(to_kwd)
          return frozenset(flags)
docs: Return the set of IMAP flags that correspond to the letter codes.
  
          Args:
              codes: The letter codes to map.