code: def take(self, indices, axis=0, out=None, mode='raise'):
          
  
          return take_haplotype_array(self, indices, axis=axis, cls=type(self), take=np.take,
                                      out=out, mode=mode)
docs: Take elements from an array along an axis.
  
          This function does the same thing as "fancy" indexing (indexing arrays
          using arrays); however, it can be easier to use if you need elements
          along a given axis.
  
          Parameters
          ----------
          indices : array_like
              The indices of the values to extract.
          axis : int, optional
              The axis over which to select values.
          out : ndarray, optional
              If provided, the result will be placed in this array. It should
              be of the appropriate shape and dtype.
          mode : {'raise', 'wrap', 'clip'}, optional
              Specifies how out-of-bounds indices will behave.
  
              * 'raise' -- raise an error (default)
              * 'wrap' -- wrap around
              * 'clip' -- clip to the range
  
              'clip' mode means that all indices that are too large are replaced
              by the index that addresses the last element along that axis. Note
              that this disables indexing with negative numbers.
  
          Returns
          -------
          subarray : ndarray
  
          Examples
          --------
          >>> import allel
          >>> h = allel.HaplotypeArray([[0, 0, 0, 1],
          ...                           [0, 1, 1, 1],
          ...                           [0, 2, -1, -1]], dtype='i1')
          >>> h.take([0, 2], axis=0)
          <HaplotypeArray shape=(2, 4) dtype=int8>
          0 0 0 1
          0 2 . .
          >>> h.take([0, 2], axis=1)
          <HaplotypeArray shape=(3, 2) dtype=int8>
          0 0
          0 1
          0 .