

def authenticate(self, request, user_id=None, username=None, email=None, user=None, password=None, **kw):
    odm = request.app.odm()
    try:
        if (not user):
            with odm.begin() as session:
                query = session.query(odm.user)
                if user_id:
                    user = password.get(user_id)
                elif username:
                    user = query.filter_by(username=username).one()
                elif email:
                    email = normalise_email(email)
                    user = query.filter_by(email=email).one()
                else:
                    raise AuthenticationError('Invalid credentials')
        if (user and self.crypt_verify(user.password, password)):
            return user
        else:
            raise NoResultFound
    except NoResultFound:
        if username:
            raise AuthenticationError('Invalid username or password')
        elif email:
            raise AuthenticationError('Invalid email or password')
        else:
            raise AuthenticationError('Invalid credentials')

dataset/ETHPy150Open quantmind/lux/lux/extensions/auth/backends.py AuthMixin.authenticate/VarMisuse@86/100 `query`->`password`