code: def test_recovery():
      deadbeefs = []
      with tempfile.TemporaryDirectory() as tmpd:
          for x in range(42):
              rb = PersistentRandomAccessQueue(tmpd, 16)
              assert 16 == rb.maxlen
  
              deadbeefs = deadbeefs[-16:]
              assert len(deadbeefs) == len(rb)
  
              samples = rb.sample(len(deadbeefs))
              if deadbeefs:
                  assert samples != sorted(samples)
                  assert deadbeefs == sorted(samples)
  
              for i in range(121):
                  data = (0x42 + i + x, "deadbeef")
                  rb.append(data)
                  deadbeefs.append(data)
  
              rb.close()
  
imports: import tempfile
  import pytest
  from pfrl.collections.persistent_collections import PersistentRandomAccessQueue
label_desc: Use image node_id 3 for calling a global function with example usage: test_recovery() without return types