docstr: The main part of augmentation, without pre- and post-processing.
  
  This method calls _augment_core which is the core algorithmic part. The
  process in this method handles `repeats` and `prob`.
  
  1. If `repeats` > 1, we first concatenate `repeats` copies of input
     into a 'super' input..
  2. Select series from the (super) input to be augmented.
  3. Apply _augment_core to the selected series.
  
  The problem of this strategy includes:
  
  1. The memory burden may be unnecessarily high for 'long-to-short'
     augmentation like cropping (say if cropping a 100-window from a
     100M-series, this strategy copies 100M-series `repeats` times).
  2. Some time-consuming computation may be duplicated, for example
     quantization with kmeans. Each series should only train a model once
     instead of `repeats` times.
  
  In those cases, the subclass of the augmenter should overwrite this
  method.
docstr_tok: ["The","main","part","of","augmentation",",","without","pre-","and","post-processing",".","This","method","calls","_augment_core","which","is","the","core","algorithmic","part",".","The","process","in","this","method","handles","`","repeats","`","and","`","prob","`",".","1",".","If","`","repeats","`",">","1",",","we","first","concatenate","`","repeats","`","copies","of","input","into","a","'super","'","input","..","2",".","Select","series","from","the","(","super",")","input","to","be","augmented",".","3",".","Apply","_augment_core","to","the","selected","series",".","The","problem","of","this","strategy","includes",":","1",".","The","memory","burden","may","be","unnecessarily","high","for","'long-to-short'","augmentation","like","cropping","(","say","if","cropping","a","100-window","from","a","100M-series",",","this","strategy","copies","100M-series","`","repeats","`","times",")",".","2",".","Some","time-consuming","computation","may","be","duplicated",",","for","example","quantization","with","kmeans",".","Each","series","should","only","train","a","model","once","instead","of","`","repeats","`","times",".","In","those","cases",",","the","subclass","of","the","augmenter","should","overwrite","this","method","."]
code: def _augment(
      self, X: np.ndarray, Y: Optional[np.ndarray]
  ) -> Tuple[np.ndarray, Optional[np.ndarray]]:
      """
      The main part of augmentation, without pre- and post-processing.
  
      This method calls _augment_core which is the core algorithmic part. The
      process in this method handles `repeats` and `prob`.
  
      1. If `repeats` > 1, we first concatenate `repeats` copies of input
         into a 'super' input..
      2. Select series from the (super) input to be augmented.
      3. Apply _augment_core to the selected series.
  
      The problem of this strategy includes:
  
      1. The memory burden may be unnecessarily high for 'long-to-short'
         augmentation like cropping (say if cropping a 100-window from a
         100M-series, this strategy copies 100M-series `repeats` times).
      2. Some time-consuming computation may be duplicated, for example
         quantization with kmeans. Each series should only train a model once
         instead of `repeats` times.
  
      In those cases, the subclass of the augmenter should overwrite this
      method.
  
      """
      rand = np.random.RandomState(self.seed)
      N = X.shape[0]
      ind = (
          rand.uniform(size=self.repeats * N) <= self.prob
      )  # indice of series to be augmented
      if Y is None:
          if self.repeats > 1:
              X_aug = np.repeat(X.copy(), self.repeats, axis=0)
          else:
              X_aug = X.copy()
          Y_aug = None
          if ind.any():
              X_aug[ind, :], Y_aug = self._augment_core(
                  X_aug[ind, :], None
              )
      else:
          if self.repeats > 1:
              X_aug = np.repeat(X.copy(), self.repeats, axis=0)
              Y_aug = np.repeat(Y.copy(), self.repeats, axis=0)
          else:
              X_aug = X.copy()
              Y_aug = Y.copy()
          if ind.any():
              X_aug[ind, :], Y_aug[ind, :] = self._augment_core(
                  X_aug[ind, :], Y_aug[ind, :]
              )
      return X_aug, Y_aug
  
imports: from abc import ABC, abstractmethod
  from copy import deepcopy
  from typing import Any, Dict, Iterator, List, Optional, Tuple, Union, overload
  import numpy
  from .None import _default_seed
label_desc: Use image node_id 15 for calling the _Augmenter obj's underlying member method code with example usage: obj._augment(X, Y) and returns: X_aug,  Y_aug