code: def test_cached_property():
      class A:
          def __init__(self, value):
              self.value = value
              self.calls = 0
  
          @cached_property
          def prop(self):
              self.calls = self.calls + 1
              return self.value
  
      a = A(2)
      assert a.calls == 0
      assert a.prop == 2
      assert a.calls == 1
      assert a.prop == 2
      assert a.calls == 1
      b = A(None)
      assert b.prop == None
  
file_path: sympy/sympy/core/tests/test_cache.py
imports: import sys
  from sympy.core.cache import cacheit, cached_property, lazy_function
  from sympy.testing.pytest import raises
label_desc: Use image node_id 4 for calling a global function with example usage: test_cached_property() and returns: self