code: def _predict_sentence(self, sentences, idx):
      last_idx = len(sentences) - 1
      direction = ""
      if self.mode == "neighbor":
          if self.sample(2) == 0:
              direction = "left"
          else:
              direction = "right"
      if self.mode == "left" or direction == "left":
          if idx == 0:
              sentences[0], sentences[last_idx] = (
                  sentences[last_idx],
                  sentences[0],
              )
          else:
              sentences[idx], sentences[idx - 1] = (
                  sentences[idx - 1],
                  sentences[idx],
              )
      elif self.mode == "right" or direction == "right":
          if idx == last_idx:
              sentences[0], sentences[idx] = (
                  sentences[idx],
                  sentences[0],
              )
          else:
              sentences[idx], sentences[idx + 1] = (
                  sentences[idx + 1],
                  sentences[idx],
              )
      elif self.mode == "random":
          idxes = self.sample(list(range(len(sentences))), num=2)
          for _id in idxes:
              if _id != idx:
                  sentences[_id], sentences[idx] = (
                      sentences[idx],
                      sentences[_id],
                  )
                  break
      return sentences
  
imports: from nlpaug.model.word_rule.word_rule import WordRule
label_desc: Use image node_id 4 for calling the Shuffle obj's underlying member method code with example usage: obj._predict_sentence(sentences, idx) and returns: sentences