def _resolve(value, model_instance=None, context=None):
if isinstance(value, basestring) and "<STR_LIT:{>" in value:<EOL><INDENT>if context is None:<EOL><INDENT>context = Context()<EOL><DEDENT>if model_instance is not None:<EOL><INDENT>context[model_instance._meta.module_name] = model_instance<EOL><DEDENT>value = Template(value).render(context)<EOL><DEDENT>return value<EOL>
Resolves any template references in the given value.