<commit_before>from django import template

register = template.Library()


@register.filter("slice_institutions", is_safe=True)
def slice_institutions(value, arg):
    """
    Returns a list sliced in two.
    """
    try:
    	if arg == '1':	
        	return value[0:len(value)//2+1]
        if arg == '2':
        	return value[len(value)//2+1:len(value)]
    except (ValueError, TypeError):
    	print value
        return value # Fail silently.


@register.inclusion_tag('dropdown.html', takes_context=True)
def dropdown(context):
	elections = context['elections']
	last_year = elections[0].created_at.year
	first_year = elections[len(elections)-1].created_at.year
	if context['drop_type'] == 'year':
		values = []
		for year in range(int(first_year), int(last_year)+1):
			values.append(year)<commit_msg>Remove unnecessary debug<commit_after>from django import template

register = template.Library()


@register.filter("slice_institutions", is_safe=True)
def slice_institutions(value, arg):
    """
    Returns a list sliced in two.
    """
    try:
    	if arg == '1':	
        	return value[0:len(value)//2+1]
        if arg == '2':
        	return value[len(value)//2+1:len(value)]
    except (ValueError, TypeError):
        return value # Fail silently.


@register.inclusion_tag('dropdown.html', takes_context=True)
def dropdown(context):
	elections = context['elections']
	last_year = elections[0].created_at.year
	first_year = elections[len(elections)-1].created_at.year
	if context['drop_type'] == 'year':
		values = []
		for year in range(int(first_year), int(last_year)+1):
			values.append(year)
{'fraction_non_alphanumeric': 0.14250309789343246, 'fraction_numerical': 0.012391573729863693, 'mean_word_length': 3.9539877300613497, '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': '6715048', 'n_tokens_mistral': 544, 'n_tokens_neox': 528, 'n_words': 113}