def memoized_property(fget):
attr_name = '<STR_LIT>'.format(fget.__name__)<EOL>@functools.wraps(fget)<EOL>def fget_memoized(self):<EOL><INDENT>if not hasattr(self, attr_name):<EOL><INDENT>setattr(self, attr_name, fget(self))<EOL><DEDENT>return getattr(self, attr_name)<EOL><DEDENT>return property(fget_memoized)<EOL>
Decorator to create memoized properties.