def saslprep(string, allow_unassigned=False):
chars = list(string)<EOL>_saslprep_do_mapping(chars)<EOL>do_normalization(chars)<EOL>check_prohibited_output(<EOL>chars,<EOL>(<EOL>stringprep.in_table_c12,<EOL>stringprep.in_table_c21,<EOL>stringprep.in_table_c22,<EOL>stringprep.in_table_c3,<EOL>stringprep.in_table_c4,<EOL>stringprep.in_table_c5,<EOL>stringprep.in_table_c6,<EOL>stringprep.in_table_c7,<EOL>stringprep.in_table_c8,<EOL>stringprep.in_table_c9<EOL>)<EOL>)<EOL>check_bidi(chars)<EOL>if not allow_unassigned:<EOL><INDENT>check_unassigned(<EOL>chars,<EOL>(<EOL>stringprep.in_table_a1,<EOL>)<EOL>)<EOL><DEDENT>return "<STR_LIT>".join(chars)<EOL>
Process the given `string` using the SASLprep profile. In the error cases
defined in `RFC 3454`_ (stringprep), a :class:`ValueError` is raised.