code: def get_candidates(
      self,
      candidate_ids,
      candidate_probas,
      target_word=None,
      n=1,
      include_punctuation=False,
  ):
      # To have random behavior, NO sorting for candidate_probas.
      results = []
      if candidate_probas is None:
          candidate_probas = [0] * len(candidate_ids)
  
      for candidate_id, candidate_proba in zip(
          candidate_ids, candidate_probas
      ):
          candidate_word = self.id2token(candidate_id)
  
          # unable to predict word
          if (
              candidate_word
              in [
                  "",
                  self.get_unknown_token(),
                  self.get_subword_prefix(),
              ]
              or "unused" in candidate_word
          ):
              continue
          # predicted same word
          if (
              target_word is not None
              and candidate_word.lower() == target_word.lower()
          ):
              continue
          # stop word
          if self.is_skip_candidate(candidate_word):
              continue
          # punctuation
          if (
              not include_punctuation
              and candidate_word in string.punctuation
          ):
              continue
  
          results.append((candidate_word, candidate_proba))
  
          if len(results) >= n:
              break
  
      return results
  
imports: import numpy
  import string
  import nlpaug.util.selection.filtering
label_desc: Use image node_id 23 for calling the LanguageModels obj's underlying member method code with example usage: obj.get_candidates(candidate_ids, candidate_probas, target_word, n, include_punctuation) and returns: results