<commit_before># pylint: disable=R0201
from django.contrib import admin
from django.urls import reverse
from django.utils.safestring import mark_safe

from accounts import models


class UserAdmin(admin.ModelAdmin):
    list_display = ('__str__', 'email', 'email_confirmed', 'is_staff',
                    'steamid', 'website', 'game_count', 'installers_link')
    list_filter = ('is_staff', 'groups')
    search_fields = ('username', 'email')

    def game_count(self, obj):
        return obj.gamelibrary.games.count()

    def installers_link(self, obj):
        installers_url = reverse('admin:games_installer_changelist')
        return mark_safe("<a href='%s?user__id__exact=%s'>Installers</a>" % (
            installers_url, obj.id
        ))
    installers_link.short_description = 'Installers'<commit_msg>Allow searching by Steamid<commit_after># pylint: disable=R0201
from django.contrib import admin
from django.urls import reverse
from django.utils.safestring import mark_safe

from accounts import models


class UserAdmin(admin.ModelAdmin):
    list_display = ('__str__', 'email', 'email_confirmed', 'is_staff',
                    'steamid', 'website', 'game_count', 'installers_link')
    list_filter = ('is_staff', 'groups')
    search_fields = ('username', 'email', 'steamid')

    def game_count(self, obj):
        return obj.gamelibrary.games.count()

    def installers_link(self, obj):
        installers_url = reverse('admin:games_installer_changelist')
        return mark_safe("<a href='%s?user__id__exact=%s'>Installers</a>" % (
            installers_url, obj.id
        ))
    installers_link.short_description = 'Installers'
{'fraction_non_alphanumeric': 0.12258454106280194, 'fraction_numerical': 0.004830917874396135, 'mean_word_length': 3.975975975975976, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '1020767', 'n_tokens_mistral': 526, 'n_tokens_neox': 498, 'n_words': 109}