code: def __sample_token(self, doc, token):
      old_topic = token.topic
      num_topics = self.__model.num_topics()
      accum_prob = np.zeros(num_topics)
      prob = np.zeros(num_topics)
      sum_ = 0
      for i in range(num_topics):
          dt_alpha = doc.topic_sum(i) + self.__model.alpha()
          wt_beta = (
              self.__model.word_topic_value(token.id, i)
              + self.__model.beta()
          )
          t_sum_beta_sum = (
              self.__model.topic_sum(i) + self.__model.beta_sum()
          )
          if i == old_topic and wt_beta > 1:
              if dt_alpha > 1:
                  dt_alpha -= 1
              wt_beta -= 1
              t_sum_beta_sum -= 1
          prob[i] = dt_alpha * wt_beta / t_sum_beta_sum
          sum_ += prob[i]
          accum_prob[i] = (
              prob[i] if i == 0 else accum_prob[i - 1] + prob[i]
          )
  
      dart = rand() * sum_
      if dart <= accum_prob[0]:
          return 0
      for i in range(1, num_topics):
          if accum_prob[i - 1] < dart <= accum_prob[i]:
              return i
      return num_topics - 1
  
imports: import os
  import numpy
  from tqdm import tqdm
  from paddlehub.common.logger import logger
  from lda_novel.document import LDADoc, SLDADoc, Token, Sentence
  from lda_novel.vose_alias import VoseAlias
  from lda_novel.util import rand, rand_k
label_desc: Use image node_id 3 for calling the GibbsSampler obj's underlying member method code with example usage: obj.__sample_token(doc, token) and returns: unknown, int, i