def acquire_context(self):
frame = None<EOL>request = None<EOL>try:<EOL><INDENT>for f in inspect.stack()[<NUM_LIT:1>:]:<EOL><INDENT>frame = f[<NUM_LIT:0>]<EOL>args, varargs, keywords, alocals = inspect.getargvalues(frame)<EOL>if not request and '<STR_LIT>' in args:<EOL><INDENT>request = alocals['<STR_LIT>']<EOL><DEDENT>if '<STR_LIT>' in args:<EOL><INDENT>return alocals['<STR_LIT>']<EOL><DEDENT><DEDENT><DEDENT>finally:<EOL><INDENT>del frame<EOL><DEDENT>return RequestContext(request)<EOL>
Inspect the stack to acquire the current context used,
to render the placeholder. I'm really sorry for this,
but if you have a better way, you are welcome !