def getattr_(obj, name, default_thunk):
    "Similar to .setdefault in dictionaries."
    try:
        return getattr(obj, name)
    except __HOLE__:
        default = default_thunk()
        setattr(obj, name, default)
        return default
dataset/ETHPy150Open nltk/nltk/nltk/decorators.py/getattr_