<commit_before># Third-Party
from django_filters import CharFilter
from django_filters import NumberFilter
from django_filters import UUIDFilter
from django_filters.rest_framework import FilterSet
from django_filters.rest_framework import OrderingFilter

# Django
from django.contrib import admin

# Local
from .models import Assignment
from .models import Award
from .models import Chart
from .models import Competitor
from .models import Contestant
from .models import Convention
from .models import Entry
from .models import Grantor
from .models import Group
from .models import Member
from .models import Office
from .models import Officer
from .models import Panelist
from .models import Person
from .models import Round
from .models import Score
from .models import Session
from .models import Venue


class OrphanListFilter(admin.SimpleListFilter):
    title = 'orphan'
    parameter_name = 'is_orphan'

    def lookups(self, request, model_admin):
        return (
            ('Yes', 'Yes'),
        )

    def queryset(self, request, queryset):
        if self.value() == 'Yes':
            return queryset.Group.objects.filter(
                kind__in=[
                    Group.KIND.quartet,
                    Group.KIND.chorus,
                    Group.KIND.chapter,
                ],
                parent__code__in=[
                    'EVG',
                    'FWD',
                    'LOL',
                    'MAD'
                    'NED',
                    'SWD',
                ],
                status=Group.STATUS.active,
            )


class MCListFilter(admin.SimpleListFilter):
    title = 'Member Center'
    parameter_name = 'is_mc'

    def lookups(self, request, model_admin):
        return (
            ('Yes', 'Yes'),
            ('No', 'No'),
        )

    def queryset(self, request, queryset):
        if self.value() == 'Yes':<commit_msg>Fix orphan filter<commit_after># Third-Party
from django_filters import CharFilter
from django_filters import NumberFilter
from django_filters import UUIDFilter
from django_filters.rest_framework import FilterSet
from django_filters.rest_framework import OrderingFilter

# Django
from django.contrib import admin

# Local
from .models import Assignment
from .models import Award
from .models import Chart
from .models import Competitor
from .models import Contestant
from .models import Convention
from .models import Entry
from .models import Grantor
from .models import Group
from .models import Member
from .models import Office
from .models import Officer
from .models import Panelist
from .models import Person
from .models import Round
from .models import Score
from .models import Session
from .models import Venue


class OrphanListFilter(admin.SimpleListFilter):
    title = 'orphan'
    parameter_name = 'is_orphan'

    def lookups(self, request, model_admin):
        return (
            ('Yes', 'Yes'),
        )

    def queryset(self, request, queryset):
        if self.value() == 'Yes':
            return queryset.filter(
                kind__in=[
                    Group.KIND.quartet,
                    Group.KIND.chorus,
                    Group.KIND.chapter,
                ],
                parent__code__in=[
                    'EVG',
                    'FWD',
                    'LOL',
                    'MAD'
                    'NED',
                    'SWD',
                ],
                # status=Group.STATUS.active,
            )


class MCListFilter(admin.SimpleListFilter):
    title = 'Member Center'
    parameter_name = 'is_mc'

    def lookups(self, request, model_admin):
        return (
            ('Yes', 'Yes'),
            ('No', 'No'),
        )

    def queryset(self, request, queryset):
        if self.value() == 'Yes':
{'fraction_non_alphanumeric': 0.08165961945031712, 'fraction_numerical': 0.0, 'mean_word_length': 2.0573505654281097, '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': '6474442', 'n_tokens_mistral': 1013, 'n_tokens_neox': 963, 'n_words': 315}