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