def new_context(environment, template_name, blocks, vars=None, shared=None, globals=None, locals=None):
 if (vars is None):
  vars = {}
 if shared:
  parent = vars
 else:
  parent = dict((globals or ()), **vars)
 if locals:
  if shared:
   parent = dict(parent)
  for (key, value) in locals.iteritems():
   if ((key[:2] == 'l_') and (value is not missing)):
    parent[key[2:]] = value
 return Context(environment, parent, template_name, blocks)

def new_context ( environment , template_name , blocks , vars = None , shared = None , globals = None , locals = None ) : if ( vars is None ) : vars = { } if shared : parent = vars else : parent = dict ( ( globals or ( ) ) , ** vars ) if locals : if shared : parent = dict ( parent ) for ( key , value ) in locals . iteritems ( ) : if ( ( key [ : 2 ] == 'l_' ) and ( value is not missing ) ) : parent [ key [ 2 : ] ] = value return Context ( environment , parent , template_name , blocks )
internal helper to for context creation .