class_docstr: Tests ensuring that when a dataset or samples in a dataset are modified
  all relevant objects are instantly in sync within the same process.
class_docstr_tok: ["Tests","ensuring","that","when","a","dataset","or","samples","in","a","dataset","are","modified","all","relevant","objects","are","instantly","in","sync","within","the","same","process","."]
docstr: Tests that samples are singletons.
docstr_tok: ["Tests","that","samples","are","singletons","."]
code: def test_sample_singletons(self):
      """Tests that samples are singletons."""
      dataset = fo.Dataset()
  
      filepath = "test1.png"
      sample = fo.Sample(filepath=filepath)
      dataset.add_sample(sample)
      sample2 = dataset[sample.id]
      self.assertIs(sample2, sample)
  
      sample3 = fo.Sample(filepath="test2.png")
      dataset.add_sample(sample3)
      self.assertIsNot(sample3, sample)
  
      sample4 = dataset.match(
          {"filepath": os.path.abspath(filepath)}
      ).first()
      self.assertIsNot(sample4, sample)
  
file_path: fiftyone/tests/unittests/synchronization_tests.py
imports: import os
  import unittest
  import fiftyone
  from decorators import drop_datasets
label_desc: Use image node_id 2 for calling the SingleProcessSynchronizationTests obj's underlying member method code with example usage: obj.test_sample_singletons() without return types