class_docstr: Sequence of ndarrays having variable first dimension sizes.
  
  This is a container that can store multiple ndarrays where each ndarray
  might have a different first dimension size but a *common* size for the
  remaining dimensions.
  
  More generally, an instance of :class:`ArraySequence` of length $N$ is
  composed of $N$ ndarrays of shape $(d_1, d_2, ... d_D)$ where $d_1$
  can vary in length between arrays but $(d_2, ..., d_D)$ have to be the
  same for every ndarray.
class_docstr_tok: ["Sequence","of","ndarrays","having","variable","first","dimension","sizes",".","This","is","a","container","that","can","store","multiple","ndarrays","where","each","ndarray","might","have","a","different","first","dimension","size","but","a","*","common","*","size","for","the","remaining","dimensions",".","More","generally",",","an","instance","of",":","class",":","`","ArraySequence","`","of","length","$","N","$","is","composed","of","$","N","$","ndarrays","of","shape","$","(","d_1",",","d_2",",","...","d_D",")","$","where","$","d_1","$","can","vary","in","length","between","arrays","but","$","(","d_2",",","...",",","d_D",")","$","have","to","be","the","same","for","every","ndarray","."]
docstr: Appends `element` to this array sequence.
  
  Append can be a lot faster if it knows that it is appending several
  elements instead of a single element.  In that case it can cache the
  parameters it uses between append operations, in a "build cache".  To
  tell append to do this, use ``cache_build=True``.  If you use
  ``cache_build=True``, you need to finalize the append operations with
  :meth:`finalize_append`.
  
  Parameters
  ----------
  element : ndarray
      Element to append. The shape must match already inserted elements
      shape except for the first dimension.
  cache_build : {False, True}
      Whether to save the build cache from this append routine.  If True,
      append can assume it is the only player updating `self`, and the
      caller must finalize `self` after all append operations, with
      ``self.finalize_append()``.
  
  Returns
  -------
  None
  
  Notes
  -----
  If you need to add multiple elements you should consider
  `ArraySequence.extend`.
docstr_tok: ["Appends","`","element","`","to","this","array","sequence",".","Append","can","be","a","lot","faster","if","it","knows","that","it","is","appending","several","elements","instead","of","a","single","element",".","In","that","case","it","can","cache","the","parameters","it","uses","between","append","operations",",","in","a","``","build","cache","''",".","To","tell","append","to","do","this",",","use","``","cache_build=True","``",".","If","you","use","``","cache_build=True","``",",","you","need","to","finalize","the","append","operations","with",":","meth",":","`","finalize_append","`",".","Parameters","--","--","--","--","--","element",":","ndarray","Element","to","append",".","The","shape","must","match","already","inserted","elements","shape","except","for","the","first","dimension",".","cache_build",":","{","False",",","True","}","Whether","to","save","the","build","cache","from","this","append","routine",".","If","True",",","append","can","assume","it","is","the","only","player","updating","`","self","`",",","and","the","caller","must","finalize","`","self","`","after","all","append","operations",",","with","``","self.finalize_append","(",")","``",".","Returns","--","--","--","-","None","Notes","--","--","-","If","you","need","to","add","multiple","elements","you","should","consider","`","ArraySequence.extend","`","."]
code: def append(self, element, cache_build=False):
      """Appends `element` to this array sequence.
  
      Append can be a lot faster if it knows that it is appending several
      elements instead of a single element.  In that case it can cache the
      parameters it uses between append operations, in a "build cache".  To
      tell append to do this, use ``cache_build=True``.  If you use
      ``cache_build=True``, you need to finalize the append operations with
      :meth:`finalize_append`.
  
      Parameters
      ----------
      element : ndarray
          Element to append. The shape must match already inserted elements
          shape except for the first dimension.
      cache_build : {False, True}
          Whether to save the build cache from this append routine.  If True,
          append can assume it is the only player updating `self`, and the
          caller must finalize `self` after all append operations, with
          ``self.finalize_append()``.
  
      Returns
      -------
      None
  
      Notes
      -----
      If you need to add multiple elements you should consider
      `ArraySequence.extend`.
      """
      element = np.asarray(element)
      if element.size == 0:
          return
      el_shape = element.shape
      n_items, common_shape = el_shape[0], el_shape[1:]
      build_cache = self._build_cache
      in_cached_build = build_cache is not None
      if not in_cached_build:  # One shot append, not part of sequence
          build_cache = _BuildCache(self, common_shape, element.dtype)
      next_offset = build_cache.next_offset
      req_rows = next_offset + n_items
      if self._data.shape[0] < req_rows:
          self._resize_data_to(req_rows, build_cache)
      self._data[next_offset:req_rows] = element
      build_cache.offsets.append(next_offset)
      build_cache.lengths.append(n_items)
      build_cache.next_offset = req_rows
      if in_cached_build:
          return
      if cache_build:
          self._build_cache = build_cache
      else:
          build_cache.update_seq(self)
  
imports: import numbers
  from functools import reduce
  from operator import mul
  import numpy
label_desc: Use image node_id 9 for calling the ArraySequence obj's underlying member method code with example usage: obj.append(element, cache_build) without return types