<commit_before>import django_filters
from rest_framework import filters

from bulbs.super_features.utils import get_superfeature_model

SUPERFEATURE_MODEL = get_superfeature_model()


def filter_status(queryset, value):
    if not value:
        return queryset
    else:
        return [sf for sf in queryset
                if sf.status.lower() == value.lower()]


class SuperFeatureFilter(filters.FilterSet):
    status = django_filters.CharFilter(action=filter_status)<commit_msg>add note<commit_after>import django_filters
from rest_framework import filters

from bulbs.super_features.utils import get_superfeature_model

SUPERFEATURE_MODEL = get_superfeature_model()


def filter_status(queryset, value):
    if not value:
        return queryset
    else:
        # NOTE: this list comprehension is happening because
        # status is a property, not a model field
        # see: http://stackoverflow.com/a/1205416
        return [sf for sf in queryset
                if sf.status.lower() == value.lower()]


class SuperFeatureFilter(filters.FilterSet):
    status = django_filters.CharFilter(action=filter_status)
{'fraction_non_alphanumeric': 0.0711743772241993, 'fraction_numerical': 0.006227758007117438, 'mean_word_length': 3.7468354430379747, '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': '2738961', 'n_tokens_mistral': 319, 'n_tokens_neox': 308, 'n_words': 85}