<commit_before># Django
from django.contrib.contenttypes.models import ContentType
from django.template import Library, Node

# This app
from astrobin_apps_platesolving.solver import Solver


register = Library()


@register.inclusion_tag(
    'astrobin_apps_platesolving/inclusion_tags/platesolving_machinery.html',
    takes_context = True)
def platesolving_machinery(context, target):
    content_type = ContentType.objects.get_for_model(target)
    return {
        'object_id': target.pk,
        'content_type_id': content_type.pk,
        'solution_id': target.solution.pk if target.solution else 0,
        'solution_status': target.solution.status,
    }
<commit_msg>Fix crasher<commit_after># Django
from django.contrib.contenttypes.models import ContentType
from django.template import Library, Node

# This app
from astrobin_apps_platesolving.solver import Solver


register = Library()


@register.inclusion_tag(
    'astrobin_apps_platesolving/inclusion_tags/platesolving_machinery.html',
    takes_context = True)
def platesolving_machinery(context, target):
    content_type = ContentType.objects.get_for_model(target)
    return {
        'object_id': target.pk,
        'content_type_id': content_type.pk,
        'solution_id': target.solution.pk if target.solution else 0,
        'solution_status': target.solution.status if target.solution else 0,
    }

{'fraction_non_alphanumeric': 0.08648255813953488, 'fraction_numerical': 0.002180232558139535, 'mean_word_length': 4.48605577689243, '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': '6348175', 'n_tokens_mistral': 436, 'n_tokens_neox': 411, 'n_words': 87}