<commit_before>import datetime
import traceback

from django.conf import settings
from django.db import connection
from django.http import JsonResponse
from elasticsearch.exceptions import TransportError
from rest_framework import status
from rest_framework.decorators import api_view, permission_classes
from rest_framework.permissions import AllowAny
from rest_framework.response import Response

try:
    import newrelic.agent
except ImportError:  # pragma: no cover
    newrelic = None  # pylint: disable=invalid-name
if not settings.ES_DISABLED:
    from haystack import connections

    def get_es():
        return connections['default'].get_backend().conn


@api_view(['GET'])
@permission_classes([AllowAny])
def root(request):  # pylint: disable=unused-argument
    """
    Root view.
    """
    return Response({
        "name": "edX Notes API",
        "version": "1"
    })
<commit_msg>OeX_ES-23: Replaces haystack to elasticsearch_dsl for notesserver views health checkers.<commit_after>import datetime
import traceback

from django.conf import settings
from django.db import connection
from django.http import JsonResponse
from elasticsearch.exceptions import TransportError
from rest_framework import status
from rest_framework.decorators import api_view, permission_classes
from rest_framework.permissions import AllowAny
from rest_framework.response import Response

try:
    import newrelic.agent
except ImportError:  # pragma: no cover
    newrelic = None  # pylint: disable=invalid-name
if not settings.ES_DISABLED:
    from elasticsearch_dsl.connections import connections


    def get_es():
        return connections.get_connection()


@api_view(['GET'])
@permission_classes([AllowAny])
def root(request):  # pylint: disable=unused-argument
    """
    Root view.
    """
    return Response({
        "name": "edX Notes API",
        "version": "1"
    })

{'fraction_non_alphanumeric': 0.07917109458023379, 'fraction_numerical': 0.0021253985122210413, 'mean_word_length': 4.489795918367347, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4783018', 'n_tokens_mistral': 520, 'n_tokens_neox': 511, 'n_words': 161}