def METHOD_NAME(username='flexget', password='', session=None):
    check = zxcvbn.zxcvbn(password, user_inputs=[username])
    if check['score'] < 3:
        warning = check['feedback']['warning']
        suggestions = ' '.join(check['feedback']['suggestions'])
        message = f'Password \'{password}\' is not strong enough. '
        if warning:
            message += warning + ' '
        if suggestions:
            message += f'Suggestions: {suggestions}'
        raise WeakPassword(message)
    user = get_user(username=username, session=session)
    user.password = str(generate_password_hash(password))
    session.commit()