def resolve(self, key, is_local):
try:<EOL><INDENT>if is_local:<EOL><INDENT>return self.scope[key]<EOL><DEDENT>if self.has_resolvers:<EOL><INDENT>return self.resolvers[key]<EOL><DEDENT>assert not is_local and not self.has_resolvers<EOL>return self.scope[key]<EOL><DEDENT>except KeyError:<EOL><INDENT>try:<EOL><INDENT>return self.temps[key]<EOL><DEDENT>except KeyError:<EOL><INDENT>raise compu.ops.UndefinedVariableError(key, is_local)<EOL><DEDENT><DEDENT>
Resolve a variable name in a possibly local context

        Parameters
        ----------
        key : str
            A variable name
        is_local : bool
            Flag indicating whether the variable is local or not (prefixed with
            the '@' symbol)

        Returns
        -------
        value : object
            The value of a particular variable