def METHOD_NAME(self, attacked_text, indices_to_replace):
    """Returns a list of all possible transformations for `text`.
    If indices_to_replace is set, only replaces words at those
    indices.
    """
    transformations = []
    for word, idx in self._get_replacement_words_by_grad(
        attacked_text, indices_to_replace
    ):
        transformations.append(attacked_text.replace_word_at_index(idx, word))
    return transformations