code: def test_auto_attr():
      class MagicProp:
          @auto_attr
          def a(self):
              return object()
  
      x = MagicProp()
      assert "a" not in x.__dict__
      obj = x.a
      assert "a" in x.__dict__
      # Each call to object() produces a unique object. Verify we get the same one every time.
      assert x.a is obj
  
imports: import pytest
  from nibabel.onetime import auto_attr, setattr_on_read
  from nibabel.testing import expires
label_desc: Use image node_id 2 for calling a global function with example usage: test_auto_attr() and returns: object