<commit_before>from django.template.defaultfilters import truncatechars
from django.utils.html import format_html
from django.contrib import admin
from django.conf import settings

from app import models


def image_tag(url):
    return format_html(
        "<img src='{root}{url}' />".format(
            root=settings.MEDIA_URL or '',
            url=url,
        )
    )


@admin.register(models.Connection)
class ConnectionAdmin(admin.ModelAdmin):
    list_display = (
        'id', 'name', 'show_image', 'short_description',
        'last_modified', 'created'
    )
    fields = (
        'name', 'image', 'iframe_url', 'description', 'point_a', 'point_b'
    )

    def short_description(self, obj):
        return truncatechars(obj.description, 50)

    def show_image(self, obj):
        image_obj = obj.image
        if image_obj is None:
            return '-'
        image = image_obj.image
        if not image:
            return '-'
        return image_tag(image)


@admin.register(models.Image)
class ImageAdmin(admin.ModelAdmin):
    list_display = (<commit_msg>remove point_a and point_b from admin panel<commit_after>from django.template.defaultfilters import truncatechars
from django.utils.html import format_html
from django.contrib import admin
from django.conf import settings

from app import models


def image_tag(url):
    return format_html(
        "<img src='{root}{url}' />".format(
            root=settings.MEDIA_URL or '',
            url=url,
        )
    )


@admin.register(models.Connection)
class ConnectionAdmin(admin.ModelAdmin):
    list_display = (
        'id', 'name', 'show_image', 'short_description',
        'last_modified', 'created'
    )
    fields = ('name', 'image', 'iframe_url', 'description')

    def short_description(self, obj):
        return truncatechars(obj.description, 50)

    def show_image(self, obj):
        image_obj = obj.image
        if image_obj is None:
            return '-'
        image = image_obj.image
        if not image:
            return '-'
        return image_tag(image)


@admin.register(models.Image)
class ImageAdmin(admin.ModelAdmin):
    list_display = (
{'fraction_non_alphanumeric': 0.11049210770659239, 'fraction_numerical': 0.0018570102135561746, 'mean_word_length': 2.774080560420315, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3679145', 'n_tokens_mistral': 637, 'n_tokens_neox': 621, 'n_words': 154}