code: def get_aug_idxes(
      augmenter: Augmenter,
      tokens: List[str],
      filtered_idxes: List[int],
      aug_cnt: int,
      mode: str,
      min_char: Optional[int] = None,
  ) -> List[int]:
      assert (
          mode in Method.getall()
      ), "Expected 'mode' to be a value defined in nlpaug.util.method.Method"
  
      priority_idxes = []
      priority_words = getattr(augmenter, "priority_words", None)
      ignore_words = getattr(augmenter, "ignore_words", set())
  
      if mode == Method.WORD and priority_words is not None:
          priority_words_set = set(priority_words)
          for i, token in enumerate(tokens):
              if (
                  token in priority_words_set
                  and token.lower() not in ignore_words
              ):
                  if min_char is None or len(token) >= min_char:
                      priority_idxes.append(i)
  
      idxes = []
      for i in filtered_idxes:
          if i not in priority_idxes:
              if (
                  min_char is None or len(tokens[i]) >= min_char
              ) and tokens[i].lower() not in ignore_words:
                  idxes.append(i)
  
      if len(priority_idxes) + len(idxes) == 0:
          return []
  
      if len(priority_idxes) <= aug_cnt:
          aug_idxes = priority_idxes
          aug_cnt -= len(priority_idxes)
          if len(idxes) < aug_cnt:
              aug_cnt = len(idxes)
          aug_idxes += augmenter.sample(idxes, aug_cnt)
      else:
          aug_idxes = augmenter.sample(priority_idxes, aug_cnt)
  
      return aug_idxes
  
file_path: AugLy/augly/text/augmenters/utils.py
imports: import re
  from typing import List, Optional, Tuple
  import regex
  from augly.utils.libsndfile import install_libsndfile
  from nlpaug import Augmenter
  from nlpaug.util import Method
label_desc: Use image node_id 6 for calling a global function with example usage: get_aug_idxes(augmenter, tokens, filtered_idxes, aug_cnt, mode, min_char) and returns: aug_idxes, list