code: def sample_doc(self, doc):
      if isinstance(doc, LDADoc) and not isinstance(doc, SLDADoc):
          for i in range(doc.size()):
              new_topic = self.__sample_token(doc, doc.token(i))
              doc.set_topic(i, new_topic)
      elif isinstance(doc, SLDADoc):
          for i in range(doc.size()):
              new_topic = self.__sample_sentence(doc, doc.sent(i))
              doc.set_topic(i, new_topic)
  
imports: import numpy
  from tqdm import tqdm
  from paddlehub.common.logger import logger
  from lda_news.document import LDADoc, SLDADoc, Token, Sentence
  from lda_news.vose_alias import VoseAlias
  from lda_news.util import rand, rand_k
label_desc: Use image node_id 3 for calling the MHSampler obj's underlying member method code with example usage: obj.sample_doc(doc) without return types