code: def test_history(self):
      sb = SArrayBuilder(int, history_size=10)
      sb.append_multiple((i for i in range(8)))
      hist = sb.read_history(3)
      self.assertEqual(hist, [5, 6, 7])
  
      hist = sb.read_history(20)
      self.assertEqual(hist, [i for i in range(8)])
      hist = sb.read_history()
      self.assertEqual(hist, [i for i in range(8)])
  
      sb.append_multiple((i for i in range(5)))
      hist = sb.read_history(10)
      self.assertEqual(hist, [3, 4, 5, 6, 7, 0, 1, 2, 3, 4])
  
      sb.append(50)
      hist = sb.read_history(10)
      self.assertEqual(hist, [4, 5, 6, 7, 0, 1, 2, 3, 4, 50])
  
      hist = sb.read_history(-1)
      self.assertEqual(hist, [])
      hist = sb.read_history(0)
      self.assertEqual(hist, [])
  
      sa = sb.close()
      self.__test_equal(
          sa, [i for i in range(8)] + [i for i in range(5)] + [50], int
      )
  
file_path: turicreate/src/python/turicreate/test/test_sarray_builder.py
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  from ..data_structures.sarray_builder import SArrayBuilder
  import unittest
  import array
  import datetime
  from .._cython.cy_flexible_type import GMT
  import pytest
label_desc: Use image node_id 5 for calling the SArrayBuilderTest obj's underlying member method code with example usage: obj.test_history() without return types