def _get_vars(self, stack, scopes):
variables = itertools.product(scopes, stack)<EOL>for scope, (frame, _, _, _, _, _) in variables:<EOL><INDENT>try:<EOL><INDENT>d = getattr(frame, '<STR_LIT>' + scope)<EOL>self.scope = self.scope.new_child(d)<EOL><DEDENT>finally:<EOL><INDENT>del frame<EOL><DEDENT><DEDENT>
Get specifically scoped variables from a list of stack frames.

        Parameters
        ----------
        stack : list
            A list of stack frames as returned by ``inspect.stack()``
        scopes : sequence of strings
            A sequence containing valid stack frame attribute names that
            evaluate to a dictionary. For example, ('locals', 'globals')