<commit_before># -*- coding: utf-8  -*-
import barcode
import urllib2
import json
import StringIO
import qrcode
import qrcode.image.svg

from django.core.exceptions import ValidationError
from django.core.files.base import ContentFile
from django.http import HttpResponseRedirect
from django.template.loader import get_template
from django.utils import timezone

from core.utils import hindi_to_arabic
from post_office import mail
from wkhtmltopdf.utils import render_pdf_from_template
from .models import Event, SessionRegistration
import accounts.utils
import clubs.utils


WKHTMLTOPDF_OPTIONS = {'margin-top': 20, 'margin-right': 20,
                       'margin-left': 20, 'page-size': 'A7', }
BARCODE_LENGTH = 8

def can_see_all_barcodes(user, barcode_user=None, event=None):
    if barcode_user == user or\
       event and is_attendance_team_member(user, event) or \
       event and is_organizing_team_member(user, event) or \
       user.is_superuser:
        return True
    else:
        return False

def can_evaluate_abstracts(user, event):
    if user.is_superuser:
        return True
    elif event.abstract_revision_team:
        return clubs.utils.is_team_coordinator_or_member(event.abstract_revision_team, user)
    else:
        return False

def check_if_closed(event):
    if event.registration_closing_date and \
       timezone.now() > event.registration_closing_date:
        return HttpResponseRedirect(reverse('events:registration_closed'))

def get_user_organizing_events(user):
    if not user.is_authenticated():
        return Event.objects.none()
    elif user.is_superuser:<commit_msg>Update WKHTMLTOPDF settings<commit_after># -*- coding: utf-8  -*-
import barcode
import urllib2
import json
import StringIO
import qrcode
import qrcode.image.svg

from django.core.exceptions import ValidationError
from django.core.files.base import ContentFile
from django.http import HttpResponseRedirect
from django.template.loader import get_template
from django.utils import timezone

from core.utils import hindi_to_arabic
from post_office import mail
from wkhtmltopdf.utils import render_pdf_from_template
from .models import Event, SessionRegistration
import accounts.utils
import clubs.utils


WKHTMLTOPDF_OPTIONS = {'margin-top': 10, 'margin-right': 10,
                       'margin-left': 10, 'margin-bottom': 5,
                       'page-size': 'A7', }
BARCODE_LENGTH = 8

def can_see_all_barcodes(user, barcode_user=None, event=None):
    if barcode_user == user or\
       event and is_attendance_team_member(user, event) or \
       event and is_organizing_team_member(user, event) or \
       user.is_superuser:
        return True
    else:
        return False

def can_evaluate_abstracts(user, event):
    if user.is_superuser:
        return True
    elif event.abstract_revision_team:
        return clubs.utils.is_team_coordinator_or_member(event.abstract_revision_team, user)
    else:
        return False

def check_if_closed(event):
    if event.registration_closing_date and \
       timezone.now() > event.registration_closing_date:
        return HttpResponseRedirect(reverse('events:registration_closed'))

def get_user_organizing_events(user):
    if not user.is_authenticated():
        return Event.objects.none()
    elif user.is_superuser:
{'fraction_non_alphanumeric': 0.07547741739921188, 'fraction_numerical': 0.006365565322825098, 'mean_word_length': 3.888888888888889, 'pattern_counts': {'":': 0, '<': 3, '<?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': '7080800', 'n_tokens_mistral': 1014, 'n_tokens_neox': 973, 'n_words': 251}