def METHOD_NAME(self, email, password):
    user = None
    if email and password:
        user = self.authenticate(email=email, password=password)
    else:
        msg = _('Must include "email" and "password".')
        raise AuthenticationFailed(msg)
    return user