def parse_role_attrs(role_attr_flags):
 if (',' in role_attr_flags):
  flag_set = frozenset((r.upper() for r in role_attr_flags.split(',')))
 elif role_attr_flags:
  flag_set = frozenset((role_attr_flags.upper(),))
 else:
  flag_set = frozenset()
 if (not flag_set.issubset(VALID_FLAGS)):
  raise InvalidFlagsError(('Invalid role_attr_flags specified: %s' % ' '.join(flag_set.difference(VALID_FLAGS))))
 o_flags = ' '.join(flag_set)
 return o_flags

def parse_role_attrs ( role_attr_flags ) : if ( ',' in role_attr_flags ) : flag_set = frozenset ( ( r . upper ( ) for r in role_attr_flags . split ( ',' ) ) ) elif role_attr_flags : flag_set = frozenset ( ( role_attr_flags . upper ( ) , ) ) else : flag_set = frozenset ( ) if ( not flag_set . issubset ( VALID_FLAGS ) ) : raise InvalidFlagsError ( ( 'Invalid role_attr_flags specified: %s' % ' ' . join ( flag_set . difference ( VALID_FLAGS ) ) ) ) o_flags = ' ' . join ( flag_set ) return o_flags
parse role attributes string for user creation .