@contextlib.contextmanager<EOL><INDENT>def _scoped_variables(self, nodes_list, **kwargs):<DEDENT>
tmp_vars = []<EOL>for node in nodes_list:<EOL><INDENT>is_assign_node = isinstance(node, nodes.Assign)<EOL>name = node.target.name if is_assign_node else node.name<EOL>tmp_var = next(self.temp_var_names)<EOL>with self._execution():<EOL><INDENT>self.output.write('<STR_LIT>' % (tmp_var, self.context_name, name))<EOL>self.output.write('<STR_LIT>' % (self.context_name, name))<EOL>if is_assign_node:<EOL><INDENT>self._process_node(node.node, **kwargs)<EOL><DEDENT>else:<EOL><INDENT>self.output.write(node.name)<EOL><DEDENT>self.output.write('<STR_LIT:;>')<EOL><DEDENT>tmp_vars.append((tmp_var, name))<EOL><DEDENT>yield<EOL>for tmp_var, name in tmp_vars:<EOL><INDENT>with self._execution():<EOL><INDENT>self.output.write('<STR_LIT>' % (self.context_name, name, tmp_var))<EOL><DEDENT><DEDENT>
Context manager for creating scoped variables defined by the nodes in `nodes_list`.
These variables will be added to the context, and when the context manager exits the
context object will be restored to it's previous state.