<commit_before>from .models import Session


class Tracking(object):
    """The default tracking middleware logs all successful responses as a 'visit' variable with
    the URL path as its value."""

    def process_response(self, request, response):
        if response.status_code == 200:
            session = Session.objects.for_request(request)
            session.record("visit", request.path)
        return response<commit_msg>Disable use tracking of all heartbeat app urls.<commit_after>from .models import Session


class Tracking(object):
    """The default tracking middleware logs all successful responses as a 'visit' variable with
    the URL path as its value."""

    def process_response(self, request, response):
        if request.path.startswith('/heartbeat/'):
            return response

        if response.status_code == 200:
            session = Session.objects.for_request(request)
            session.record("visit", request.path)
        return response
{'fraction_non_alphanumeric': 0.08536585365853659, 'fraction_numerical': 0.006097560975609756, 'mean_word_length': 3.1041666666666665, 'pattern_counts': {'":': 0, '<': 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': '5254052', 'n_tokens_mistral': 246, 'n_tokens_neox': 233, 'n_words': 86}