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: Get sequence(s) through standard or advanced numpy indexing.
  
  Parameters
  ----------
  idx : int or slice or list or ndarray
      If int, index of the element to retrieve.
      If slice, use slicing to retrieve elements.
      If list, indices of the elements to retrieve.
      If ndarray with dtype int, indices of the elements to retrieve.
      If ndarray with dtype bool, only retrieve selected elements.
  
  Returns
  -------
  ndarray or :class:`ArraySequence`
      If `idx` is an int, returns the selected sequence.
      Otherwise, returns a :class:`ArraySequence` object which is a view
      of the selected sequences.
docstr_tok: ["Get","sequence","(","s",")","through","standard","or","advanced","numpy","indexing",".","Parameters","--","--","--","--","--","idx",":","int","or","slice","or","list","or","ndarray","If","int",",","index","of","the","element","to","retrieve",".","If","slice",",","use","slicing","to","retrieve","elements",".","If","list",",","indices","of","the","elements","to","retrieve",".","If","ndarray","with","dtype","int",",","indices","of","the","elements","to","retrieve",".","If","ndarray","with","dtype","bool",",","only","retrieve","selected","elements",".","Returns","--","--","--","-","ndarray","or",":","class",":","`","ArraySequence","`","If","`","idx","`","is","an","int",",","returns","the","selected","sequence",".","Otherwise",",","returns","a",":","class",":","`","ArraySequence","`","object","which","is","a","view","of","the","selected","sequences","."]
code: def __getitem__(self, idx):
      """Get sequence(s) through standard or advanced numpy indexing.
  
      Parameters
      ----------
      idx : int or slice or list or ndarray
          If int, index of the element to retrieve.
          If slice, use slicing to retrieve elements.
          If list, indices of the elements to retrieve.
          If ndarray with dtype int, indices of the elements to retrieve.
          If ndarray with dtype bool, only retrieve selected elements.
  
      Returns
      -------
      ndarray or :class:`ArraySequence`
          If `idx` is an int, returns the selected sequence.
          Otherwise, returns a :class:`ArraySequence` object which is a view
          of the selected sequences.
      """
      if isinstance(idx, (numbers.Integral, np.integer)):
          start = self._offsets[idx]
          return self._data[start : start + self._lengths[idx]]
  
      seq = self.__class__()
      seq._is_view = True
      if isinstance(idx, tuple):
          off_idx = idx[0]
          seq._data = self._data.__getitem__((slice(None),) + idx[1:])
      else:
          off_idx = idx
          seq._data = self._data
  
      if isinstance(off_idx, slice):  # Standard list slicing
          seq._offsets = self._offsets[off_idx]
          seq._lengths = self._lengths[off_idx]
          return seq
  
      if isinstance(
          off_idx, (list, range)
      ) or is_ndarray_of_int_or_bool(off_idx):
          # Fancy indexing
          seq._offsets = self._offsets[off_idx]
          seq._lengths = self._lengths[off_idx]
          return seq
  
      raise TypeError(
          "Index must be either an int, a slice, a list of int"
          " or a ndarray of bool! Not " + str(type(idx))
      )
  
imports: import numbers
  from functools import reduce
  from operator import mul
  import numpy
label_desc: Use image node_id 15 for calling the ArraySequence obj's underlying member method code with example usage: obj.__getitem__(idx) and returns: self, seq, seq