code: def test_history(self):
      from ..data_structures.sframe_builder import SFrameBuilder
  
      sb = SFrameBuilder([int, float], history_size=10)
      sb.append_multiple(([i, i + 0.0] for i in range(8)))
      hist = sb.read_history(3)
      self.assertEqual(hist, [[5, 5.0], [6, 6.0], [7, 7.0]])
  
      hist = sb.read_history(20)
      self.assertEqual(hist, [[i, i + 0.0] for i in range(8)])
      hist = sb.read_history()
      self.assertEqual(hist, [[i, i + 0.0] for i in range(8)])
  
      sb.append_multiple(([i, i + 0.0] for i in range(5)))
      hist = sb.read_history(10)
      self.assertEqual(
          hist, [[i, i + 0.0] for i in [3, 4, 5, 6, 7, 0, 1, 2, 3, 4]]
      )
  
      sb.append([50, 50.0])
      hist = sb.read_history(10)
      self.assertEqual(
          hist, [[i, i + 0.0] for i in [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, [])
  
      expected_data = (
          [[i, i + 0.0] for i in range(8)]
          + [[i, i + 0.0] for i in range(5)]
          + [[50, 50.0]]
      )
      cols = [[], []]
      for i in expected_data:
          cols[0].append(i[0])
          cols[1].append(i[1])
      expected_sf = SFrame({"X1": cols[0], "X2": cols[1]})
  
      sf = sb.close()
      _assert_sframe_equal(sf, expected_sf)
  
file_path: turicreate/src/python/turicreate/test/test_sframe_builder.py
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  from ..data_structures.sframe import SFrame
  import unittest
  import array
  import datetime
  from .._cython.cy_flexible_type import GMT
  from ..util import _assert_sframe_equal
  import pytest
label_desc: Use image node_id 3 for calling the SFrameBuilderTest obj's underlying member method code with example usage: obj.test_history() without return types