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: Append multiple elements to an SArray.
  
  Throws a RuntimeError if the type of `data` is incompatible with
  the type of the SArray.
  
  Parameters
  ----------
  data  : any SArray-supported type
      A data element to add to the SArray.
  
  segment : int
      The segment to write this element. Each segment is numbered
      sequentially, starting with 0. Any value in segment 1 will be after
      any value in segment 0, and the order of elements in each segment is
      preserved as they are added.
docstr_tok: ["Append","multiple","elements","to","an","SArray",".","Throws","a","RuntimeError","if","the","type","of","`","data","`","is","incompatible","with","the","type","of","the","SArray",".","Parameters","--","--","--","--","--","data",":","any","SArray-supported","type","A","data","element","to","add","to","the","SArray",".","segment",":","int","The","segment","to","write","this","element",".","Each","segment","is","numbered","sequentially",",","starting","with","0",".","Any","value","in","segment","1","will","be","after","any","value","in","segment","0",",","and","the","order","of","elements","in","each","segment","is","preserved","as","they","are","added","."]
code: def append_multiple(self, data, segment=0):
      """
      Append multiple elements to an SArray.
  
      Throws a RuntimeError if the type of `data` is incompatible with
      the type of the SArray.
  
      Parameters
      ----------
      data  : any SArray-supported type
          A data element to add to the SArray.
  
      segment : int
          The segment to write this element. Each segment is numbered
          sequentially, starting with 0. Any value in segment 1 will be after
          any value in segment 0, and the order of elements in each segment is
          preserved as they are added.
      """
      if not hasattr(data, "__iter__"):
          raise TypeError(
              "append_multiple must be passed an iterable object"
          )
      tmp_list = []
  
      for i in data:
          tmp_list.append(i)
          if len(tmp_list) >= self._block_size:
              self._builder.append_multiple(tmp_list, segment)
              tmp_list = []
      if len(tmp_list) > 0:
          self._builder.append_multiple(tmp_list, 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 3 for calling the SArrayBuilder obj's underlying member method code with example usage: obj.append_multiple(data, segment) without return types