def is_authenticated(self, request, **kwargs):
        """
        Checks a user's basic auth credentials against the current
        Django auth backend.

        Should return either ``True`` if allowed, ``False`` if not or an
        ``HttpResponse`` if you need something custom.
        """
        try:
            username, password = self.extract_credentials(request)
        except __HOLE__:
            return self._unauthorized()

        if not username or not password:
            return self._unauthorized()

        if self.backend:
            user = self.backend.authenticate(
                username=username,
                password=password
            )
        else:
            user = authenticate(username=username, password=password)

        if user is None:
            return self._unauthorized()

        if not self.check_active(user):
            return False

        request.user = user
        return True
dataset/ETHPy150Open django-tastypie/django-tastypie/tastypie/authentication.py/BasicAuthentication.is_authenticated