class_docstr: Test the iteration functionality provided by io.SamReader.
docstr: Verify that iteration provides results incrementally, not all at once.
code: def test_bam_iterate_partially(self):
      """Verify that iteration provides results incrementally, not all at once."""
      reader = sam.SamReader(
          test_utils.genomics_core_testdata("test.bam")
      )
      with reader:
          iterable = reader.iterate()
          # We expect 106 records in total.
          for _ in range(10):
              results = list(itertools.islice(iterable, 10))
              self.assertEqual(len(results), 10)
          results = list(itertools.islice(iterable, 10))
          self.assertEqual(len(results), 6)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import itertools
  from absl.testing import absltest
  from absl.testing import parameterized
  import six
  from etils import epath
  from third_party.nucleus.io import sam
  from third_party.nucleus.io import tfrecord
  from third_party.nucleus.protos import reads_pb2
  from third_party.nucleus.protos import reference_pb2
  from third_party.nucleus.testing import test_utils
  from third_party.nucleus.util import ranges
label_desc: Use image node_id 3 for calling the SamReaderTests obj's underlying member method code with example usage: obj.test_bam_iterate_partially() without return types