<commit_before>from django.template import Context, Template
from django.template.loader import get_template
from django import template


register = template.Library()

@register.filter
def as_uni_form(form):
    template = get_template('uni_form/uni_form.html')
    c = Context({'form':form})
    return template.render(c)
    
####################################
# Everything below is experiamental
####################################
    
    
@register.tag(name="uni_form")    
def do_uni_form(parser, token):
    token = token.split_contents()
    tag_name = token.pop(0)
    try:
        form = token.pop(0)
    except IndexError:
        msg = '%r tag requires a form to process' % token.contents[0] 
        raise template.TemplateSyntaxError(msg) 
        
    if token:
        # we have token elements left, and these must be buttons
        return UniFormNode(form,token)
        
    return UniFormNode(form)
        
class Button(object):
    
    def __init__(self,name,button_type=None,value=None,button_id=None,button_class=None):
        self.name = name
        if button_type:
            self.type = button_type
        else:
            self.type = 'button'<commit_msg>Fixing a spelling mistake<commit_after>from django.template import Context, Template
from django.template.loader import get_template
from django import template


register = template.Library()

@register.filter
def as_uni_form(form):
    template = get_template('uni_form/uni_form.html')
    c = Context({'form':form})
    return template.render(c)
    
####################################
# Everything below is experimental
####################################
    
    
@register.tag(name="uni_form")    
def do_uni_form(parser, token):
    token = token.split_contents()
    tag_name = token.pop(0)
    try:
        form = token.pop(0)
    except IndexError:
        msg = '%r tag requires a form to process' % token.contents[0] 
        raise template.TemplateSyntaxError(msg) 
        
    if token:
        # we have token elements left, and these must be buttons
        return UniFormNode(form,token)
        
    return UniFormNode(form)
        
class Button(object):
    
    def __init__(self,name,button_type=None,value=None,button_id=None,button_class=None):
        self.name = name
        if button_type:
            self.type = button_type
        else:
            self.type = 'button'
{'fraction_non_alphanumeric': 0.14672780325135473, 'fraction_numerical': 0.0025010421008753647, 'mean_word_length': 3.0268456375838926, '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': '6065069', 'n_tokens_mistral': 684, 'n_tokens_neox': 668, 'n_words': 164}