class_docstr: An interface to incrementally build an SArray element by element.
  
  Once closed, the SArray cannot be "reopened" using this interface.
  
  Parameters
  ----------
  dtype : type
      The type of the elements in the SArray.
  
  num_segments : int, optional
      Number of segments that can be written in parallel.
  
  history_size : int, optional
      The number of elements to be cached as history. Caches the last
      `history_size` elements added with `append` or `append_multiple`.
  
  Returns
  -------
  out : SArrayBuilder
  
  Examples
  --------
  >>> from turicreate import SArrayBuilder
  
  >>> sb = SArrayBuilder(int)
  
  >>> sb.append(1)
  
  >>> sb.append_multiple([2,3])
  
  >>> sb.close()
  dtype: int
  Rows: 3
  [1, 2, 3]
class_docstr_tok: ["An","interface","to","incrementally","build","an","SArray","element","by","element",".","Once","closed",",","the","SArray","can","not","be","``","reopened","''","using","this","interface",".","Parameters","--","--","--","--","--","dtype",":","type","The","type","of","the","elements","in","the","SArray",".","num_segments",":","int",",","optional","Number","of","segments","that","can","be","written","in","parallel",".","history_size",":","int",",","optional","The","number","of","elements","to","be","cached","as","history",".","Caches","the","last","`","history_size","`","elements","added","with","`","append","`","or","`","append_multiple","`",".","Returns","--","--","--","-","out",":","SArrayBuilder","Examples","--","--","--","--",">",">",">","from","turicreate","import","SArrayBuilder",">",">",">","sb","=","SArrayBuilder","(","int",")",">",">",">","sb.append","(","1",")",">",">",">","sb.append_multiple","(","[","2,3","]",")",">",">",">","sb.close","(",")","dtype",":","int","Rows",":","3","[","1",",","2",",","3","]"]
docstr: Outputs the last `num` elements that were appended either by `append` or
  `append_multiple`.
  
  Returns
  -------
  out : list
docstr_tok: ["Outputs","the","last","`","num","`","elements","that","were","appended","either","by","`","append","`","or","`","append_multiple","`",".","Returns","--","--","--","-","out",":","list"]
code: def read_history(self, num=10, segment=0):
      """
      Outputs the last `num` elements that were appended either by `append` or
      `append_multiple`.
  
      Returns
      -------
      out : list
  
      """
      if num < 0:
          num = 0
      if segment < 0:
          raise TypeError("segment must be >= 0")
      return self._builder.read_history(num, segment)
  
file_path: turicreate/src/python/turicreate/data_structures/sarray_builder.py
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  from .._cython.cy_sarray_builder import UnitySArrayBuilderProxy
  from .sarray import SArray
label_desc: Use image node_id 5 for calling the SArrayBuilder obj's underlying member method code with example usage: obj.read_history(num, segment) and returns: self