code: def test_torchbind_def_property_just_getter(self):
      def foo_just_getter():
          fooGetterSetter = (
              torch.classes._TorchScriptTesting._FooGetterSetter(5, 6)
          )
          # getY method intentionally adds 4 to x
          return fooGetterSetter, fooGetterSetter.y
  
      scripted = torch.jit.script(foo_just_getter)
      out, result = scripted()
      self.assertEqual(result, 10)
  
      with self.assertRaisesRegex(RuntimeError, "can't set attribute"):
          out.y = 5
  
      def foo_not_setter():
          fooGetterSetter = (
              torch.classes._TorchScriptTesting._FooGetterSetter(5, 6)
          )
          old = fooGetterSetter.y
          fooGetterSetter.y = old + 4
          # getY method intentionally adds 4 to x
          return fooGetterSetter.y
  
      with self.assertRaisesRegexWithHighlight(
          RuntimeError,
          "Tried to set read-only attribute: y",
          "fooGetterSetter.y = old + 4",
      ):
          scripted = torch.jit.script(foo_not_setter)
  
imports: import io
  import os
  import sys
  import copy
  import unittest
  import torch
  from typing import Optional
  from torch.testing._internal.jit_utils import JitTestCase
  from torch.testing._internal.common_utils import IS_FBCODE, IS_MACOS, IS_SANDCASTLE, IS_WINDOWS, find_library_location
  from torch.testing import FileCheck
label_desc: Use image node_id 7 for calling the TestTorchbind obj's underlying member method code with example usage: obj.test_torchbind_def_property_just_getter() and returns: fooGetterSetter,  fooGetterSetter, fooGetterSetter