# Path: djinja/template/base.py
# class Library(object):
#     def __init__(self):
#         self.filters = {}
#         self.extensions = []
#         self.globals = {}
#         self.tests = {}
#     def tag(self, func,name=None):
#         if name==None:
#             name = getattr(func, "_decorated_function", func).__name__
#         self.globals[name] = func
# 
#     def filter(self, func,name=None):
#         if name==None:
#             name = getattr(func, "_decorated_function", func).__name__
#         self.filters[name] = func
# 
#     def extension(self, ext):
#         self.extensions.append(ext)
#     
#     def set(self,*args,**kwargs):
#         for k in kwargs.keys(): #is a object with a name
#             self[k] = kwargs[k]
#         for a in args:
#             self.tag(a) #is a function
#         
#     def inclusion_tag(self,template,func,takes_context=False):
#         if takes_context:
#             import jinja2
#             @jinja2.contextfunction
#             def tag(context,*args,**kwargs):
#                 from django.template.loader import render_to_string
#                 return render_to_string(template, func(dict_from_context(context),*args,**kwargs))
#             
#         else:
#             def tag(*args,**kwargs):
#                 from django.template.loader import render_to_string
#                 return render_to_string(template, func(*args,**kwargs))
#         
#         #raise Exception(getattr(func, "_decorated_function", func))
#         self.tag(tag,name=getattr(func, "_decorated_function", func).__name__) 
#     
#     def __setitem__(self, item, value):
#         self.globals[item] = value
#     
#     def __getitem__(self, item, value): #for reciprocity with __setitem__
#         return globals[item]


from djinja.template.base import Library
from jinja2.ext import Extension
from django.utils.safestring import mark_safe
from jinja2 import nodes
            from django.conf import settings
        from django.utils.html import strip_spaces_between_tags
        from djinja.template.defaultfunctions import Load
import traceback
                import warnings

register = Library()

class CsrfExtension(Extension):
    # a set of names that trigger the extension.
    tags = set(['csrf_token'])


# Path: djinja/template/base.py
# class Library(object):
#     def __init__(self):
#         self.filters = {}
#         self.extensions = []
#         self.globals = {}
#         self.tests = {}
#     def tag(self, func,name=None):
#         if name==None:
#             name = getattr(func, "_decorated_function", func).__name__
#         self.globals[name] = func
# 
#     def filter(self, func,name=None):
#         if name==None:
#             name = getattr(func, "_decorated_function", func).__name__
#         self.filters[name] = func
# 
#     def extension(self, ext):
#         self.extensions.append(ext)
#     
#     def set(self,*args,**kwargs):
#         for k in kwargs.keys(): #is a object with a name
#             self[k] = kwargs[k]
#         for a in args:
#             self.tag(a) #is a function
#         
#     def inclusion_tag(self,template,func,takes_context=False):
#         if takes_context:
#             import jinja2
#             @jinja2.contextfunction
#             def tag(context,*args,**kwargs):
#                 from django.template.loader import render_to_string
#                 return render_to_string(template, func(dict_from_context(context),*args,**kwargs))
#             
#         else:
#             def tag(*args,**kwargs):
#                 from django.template.loader import render_to_string
#                 return render_to_string(template, func(*args,**kwargs))
#         
#         #raise Exception(getattr(func, "_decorated_function", func))
#         self.tag(tag,name=getattr(func, "_decorated_function", func).__name__) 
#     
#     def __setitem__(self, item, value):
#         self.globals[item] = value
#     
#     def __getitem__(self, item, value): #for reciprocity with __setitem__
#         return globals[item]


# Path: djinja/template/defaultextensions.py
from djinja.template.base import Library
from jinja2.ext import Extension
from django.utils.safestring import mark_safe
from jinja2 import nodes
            from django.conf import settings
        from django.utils.html import strip_spaces_between_tags
        from djinja.template.defaultfunctions import Load
import traceback
                import warnings


register = Library()

class CsrfExtension(Extension):
    # a set of names that trigger the extension.
    tags = set(['csrf_token'])


    def __init__(self, environment):