code: def test_segments(self):
      from ..data_structures.sframe_builder import SFrameBuilder
  
      sb = SFrameBuilder([int], num_segments=4)
  
      sb.append_multiple(([i] for i in range(20, 30)), segment=2)
      sb.append_multiple(([i] for i in range(10, 20)), segment=1)
      sb.append_multiple(([i] for i in range(30, 40)), segment=3)
      sb.append_multiple(([i] for i in range(0, 10)), segment=0)
  
      hist = sb.read_history(3, segment=0)
      self.assertSequenceEqual(hist, [[7], [8], [9]])
      hist = sb.read_history(3, segment=1)
      self.assertSequenceEqual(hist, [[17], [18], [19]])
      hist = sb.read_history(3, segment=2)
      self.assertSequenceEqual(hist, [[27], [28], [29]])
      hist = sb.read_history(3, segment=3)
      self.assertSequenceEqual(hist, [[37], [38], [39]])
  
      sf = sb.close()
      expected_sf = SFrame({"X1": range(40)})
      _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 4 for calling the SFrameBuilderTest obj's underlying member method code with example usage: obj.test_segments() without return types