def METHOD_NAME(domain, case_id):
    from corehq.form_processor.exceptions import CaseNotFound
    from corehq.form_processor.models import CommCareCase
    try:
        case = CommCareCase.objects.get_case(case_id, domain)
        if case.domain != domain or case.is_deleted:
            raise Http404()
        return case
    except CaseNotFound:
        raise Http404()