<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def authenticate(self, username=None, password=None, **kwargs):
 """ "username" being passed is really email address and being compared to as such. """

        try:
            user = User.objects.get(email=username)
            if user.check_password(password):
                return user
        except (User.DoesNotExist, User.MultipleObjectsReturned):
            logging.warning('Unsuccessful login attempt using username/email: {0}'.format(username))

        return None