def render_template_with_system_and_user_context(value, user, context=None, prefix=None):
 context = (context or {})
 context[SYSTEM_SCOPE] = KeyValueLookup(prefix=prefix, scope=SYSTEM_SCOPE)
 context[USER_SCOPE] = UserKeyValueLookup(prefix=prefix, user=user, scope=USER_SCOPE)
 context[DATASTORE_PARENT_SCOPE] = {SYSTEM_SCOPE: KeyValueLookup(prefix=prefix, scope=FULL_SYSTEM_SCOPE), USER_SCOPE: UserKeyValueLookup(prefix=prefix, user=user, scope=FULL_USER_SCOPE)}
 rendered = render_template(value=value, context=context)
 return rendered

def render_template_with_system_and_user_context ( value , user , context = None , prefix = None ) : context = ( context or { } ) context [ SYSTEM_SCOPE ] = KeyValueLookup ( prefix = prefix , scope = SYSTEM_SCOPE ) context [ USER_SCOPE ] = UserKeyValueLookup ( prefix = prefix , user = user , scope = USER_SCOPE ) context [ DATASTORE_PARENT_SCOPE ] = { SYSTEM_SCOPE : KeyValueLookup ( prefix = prefix , scope = FULL_SYSTEM_SCOPE ) , USER_SCOPE : UserKeyValueLookup ( prefix = prefix , user = user , scope = FULL_USER_SCOPE ) } rendered = render_template ( value = value , context = context ) return rendered
render provided template with a default system context and user context for the provided user .