@eventmgr_core.handler('sasl authenticate plain')
def m_sasl_plain(info):
    cli = info['source']
    data = info['data']

    try:
        authorization_id, account, passphrase = data.split(b'\x00')
    except ValueError:
        cli.dump_numeric('904', ['SASL authentication failed'])
        cli.sasl = None
        return
    account = str(account, 'utf8')
    passphrase = str(passphrase, 'utf8')
    authorization_id = str(authorization_id, 'utf8')

    # Derive authorization_id from account name
    authorization_id = authorization_id or account

    account_info = cli.ctx.data.get('account.{}'.format(account), None)
    if (account_info and account_info['credentials'] in 'passphrase' and
            account_info['verified'] and authorization_id == account):
        passphrase_hash = account_info['credentials']['passphrase']
        if cli.ctx.hashing.verify(passphrase, passphrase_hash):
            cli.account = account
            eventmgr_core.dispatch('account change', {
                'source': cli,
                'account': account,
            })
            cli.sasl = None
            hostmask = cli.hostmask
            if hostmask is None:
                hostmask = '*'
            cli.dump_numeric('900', [hostmask, account, 'You are now logged in as {}'.format(account)])
            cli.dump_numeric('903', ['SASL authentication successful'])
            return
    cli.dump_numeric('904', ['SASL authentication failed'])
dataset/ETHPy150Open mammon-ircd/mammon/mammon/ext/ircv3/sasl.py/m_sasl_plain/swapped operands of `in`