def cached_property(func):
name = func.__name__<EOL>doc = func.__doc__<EOL>def getter(self, name=name):<EOL><INDENT>try:<EOL><INDENT>return self.__dict__[name]<EOL><DEDENT>except KeyError:<EOL><INDENT>self.__dict__[name] = value = func(self)<EOL>return value<EOL><DEDENT><DEDENT>getter.func_name = name<EOL>return property(getter, doc=doc)<EOL>
Special property decorator that caches the computed
    property value in the object's instance dict the first
    time it is accessed.