def __getattr__(self, key):
    if key.startswith('_'):
        raise AttributeError
    result = self._get_indexed_value(key, error_type=AttributeError)
    self.__dict__[key] = result
    return result
def __getattr__(self, key):
    if key.startswith('_'):
        raise AttributeError
    result = self._get_indexed_value(key, error_type=AttributeError)
    self.__dict__[key] = result
    return result