code: def _cached(f):
      
  
      attr_name = '_cached_' + f.__name__
  
      def wrapper(obj, *args, **kwargs):
          if not hasattr(obj, attr_name):
              setattr(obj, attr_name, f(obj, *args, **kwargs))
          return getattr(obj, attr_name)
      return wrapper
docs: Decorator that makes a method cached.