<commit_before>from django.conf import settings
from django.db.models import Q
from notification import models as notifications

from astrobin.models import Request
from astrobin.models import UserProfile
from astrobin.models import Gear


def privatebeta_enabled(request):
    return {'privatebeta_enabled': settings.PRIVATEBETA_ENABLE_BETA}


def notices_count(request):
    response = {}
    if request.user.is_authenticated():
        response['notifications_count'] = notifications.Notice.objects.filter(Q(user = request.user) & Q(unseen = True)).count()
        response['requests_count'] = Request.objects.filter(Q(to_user = request.user) & Q(fulfilled = False)).count()

    return response


def user_language(request):
    d = {
        'user_language': request.LANGUAGE_CODE,
    }
    if request.user.is_authenticated():
        profile = UserProfile.objects.get(user = request.user)
        d['user_language'] = profile.language

    return d


def common_variables(request):
    from rawdata.utils import user_has_subscription

    d = {
        'random_gear_item': Gear.objects.filter(moderator_fixed = None).order_by('?')[:1].get(),
        'is_producer': request.user.groups.filter(name='Producers'),
        'is_retailer': request.user.groups.filter(name='Retailers'),
        'has_rawdata_subscription': user_has_subscription(request.user),
        'IMAGES_URL' : settings.IMAGES_URL,
    }<commit_msg>Comments out piece of code that was used during the gear fixing campaign.<commit_after>from django.conf import settings
from django.db.models import Q
from notification import models as notifications

from astrobin.models import Request
from astrobin.models import UserProfile
from astrobin.models import Gear


def privatebeta_enabled(request):
    return {'privatebeta_enabled': settings.PRIVATEBETA_ENABLE_BETA}


def notices_count(request):
    response = {}
    if request.user.is_authenticated():
        response['notifications_count'] = notifications.Notice.objects.filter(Q(user = request.user) & Q(unseen = True)).count()
        response['requests_count'] = Request.objects.filter(Q(to_user = request.user) & Q(fulfilled = False)).count()

    return response


def user_language(request):
    d = {
        'user_language': request.LANGUAGE_CODE,
    }
    if request.user.is_authenticated():
        profile = UserProfile.objects.get(user = request.user)
        d['user_language'] = profile.language

    return d


def common_variables(request):
    from rawdata.utils import user_has_subscription

    d = {
        #'random_gear_item': Gear.objects.filter(moderator_fixed = None).order_by('?')[:1].get(),
        'is_producer': request.user.groups.filter(name='Producers'),
        'is_retailer': request.user.groups.filter(name='Retailers'),
        'has_rawdata_subscription': user_has_subscription(request.user),
        'IMAGES_URL' : settings.IMAGES_URL,
    }
{'fraction_non_alphanumeric': 0.11298656562177058, 'fraction_numerical': 0.0006889424733034792, 'mean_word_length': 4.167259786476868, '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': '1530112', 'n_tokens_mistral': 877, 'n_tokens_neox': 847, 'n_words': 172}