code: def cached_property(func):
      """Decorator to cache property method"""
      attrname = "__" + func.__name__
      _cached_property_sentinel = object()
  
      def propfunc(self):
          val = getattr(self, attrname, _cached_property_sentinel)
          if val is _cached_property_sentinel:
              val = func(self)
              setattr(self, attrname, val)
          return val
  
      return property(propfunc)
  
file_path: sympy/sympy/core/cache.py
imports: from importlib import import_module
  from typing import Callable
  from functools import lru_cache, wraps
label_desc: Use image node_id 5 for calling a global function with example usage: cached_property(func) and returns: property, val