'Lookup a variable or raise `KeyError` if the variable is
undefined.'

def __getitem__(self, key):

    item = self.resolve_or_missing(key)
    if (item is missing):
        raise KeyError(key)
    return item
