'Get the value associated with a name in the current context.
The current context could be an dictionary in a list, or a dictionary
outside a list.
Args:
name: name to lookup, e.g. \'foo\' or \'foo.bar.baz\'
Returns:
The value, or self.undefined_str
Raises:
UndefinedVariable if self.undefined_str is not set'

def Lookup(self, name):

    if (name == '@'):
        return self.stack[(-1)].context
    parts = name.split('.')
    value = self._LookUpStack(parts[0])
    for part in parts[1:]:
        try:
            value = value[part]
        except (KeyError, TypeError):
            return self._Undefined(part)
    return value
