def get_jinja_environment(allow_undefined=False, trim_blocks=True, lstrip_blocks=True):
 import jinja2
 undefined = (jinja2.Undefined if allow_undefined else jinja2.StrictUndefined)
 env = jinja2.Environment(undefined=undefined, trim_blocks=trim_blocks, lstrip_blocks=lstrip_blocks)
 env.filters.update(get_filters())
 env.tests['in'] = (lambda item, list: (item in list))
 return env

def get_jinja_environment ( allow_undefined = False , trim_blocks = True , lstrip_blocks = True ) : import jinja2 undefined = ( jinja2 . Undefined if allow_undefined else jinja2 . StrictUndefined ) env = jinja2 . Environment ( undefined = undefined , trim_blocks = trim_blocks , lstrip_blocks = lstrip_blocks ) env . filters . update ( get_filters ( ) ) env . tests [ 'in' ] = ( lambda item , list : ( item in list ) ) return env
sets the environment for jinja .