def sasl_mechanism(name, secure, preference = <NUM_LIT:50>):
<EOL>def decorator(klass):<EOL><INDENT>"""<STR_LIT>"""<EOL>klass._pyxmpp_sasl_secure = secure<EOL>klass._pyxmpp_sasl_preference = preference<EOL>if issubclass(klass, ClientAuthenticator):<EOL><INDENT>_register_client_authenticator(klass, name)<EOL><DEDENT>elif issubclass(klass, ServerAuthenticator):<EOL><INDENT>_register_server_authenticator(klass, name)<EOL><DEDENT>else:<EOL><INDENT>raise TypeError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>return klass<EOL><DEDENT>return decorator<EOL>
Class decorator generator for `ClientAuthenticator` or
    `ServerAuthenticator` subclasses. Adds the class to the pyxmpp.sasl
    mechanism registry.

    :Parameters:
        - `name`: SASL mechanism name
        - `secure`: if the mechanims can be considered secure - `True`
          if it can be used over plain-text channel
        - `preference`: mechanism preference level (the higher the better)
    :Types:
        - `name`: `unicode`
        - `secure`: `bool`
        - `preference`: `int`