class_docstr: Helper class for :class:`gensim.models.hdpmodel.HdpModel` to format the output of topics.
class_docstr_tok: ["Helper","class","for",":","class",":","`","gensim.models.hdpmodel.HdpModel","`","to","format","the","output","of","topics","."]
docstr: Give the most probable `num_words` words for the id `topic_id`.
  
  Warnings
  --------
  The parameter `num_words` is deprecated, will be removed in 4.0.0, please use `topn` instead.
  
  Parameters
  ----------
  topic_id : int
      Acts as a representative index for a particular topic.
  topn : int, optional
      Number of most probable words to show from given `topic_id`.
  log : bool, optional
      If True logs a message with level INFO on the logger object, False otherwise.
  formatted : bool, optional
      If True return the topics as a list of strings, False as lists of
      (word, weight) pairs.
  num_words : int, optional
      DEPRECATED, USE `topn` INSTEAD.
  
  Returns
  -------
  list of (str, numpy.float) **or** list of str
      Output format for terms from a single topic depends on the value of `self.style` attribute.
code: def show_topic(
      self,
      topic_id,
      topn=20,
      log=False,
      formatted=False,
      num_words=None,
  ):
      """Give the most probable `num_words` words for the id `topic_id`.
  
      Warnings
      --------
      The parameter `num_words` is deprecated, will be removed in 4.0.0, please use `topn` instead.
  
      Parameters
      ----------
      topic_id : int
          Acts as a representative index for a particular topic.
      topn : int, optional
          Number of most probable words to show from given `topic_id`.
      log : bool, optional
          If True logs a message with level INFO on the logger object, False otherwise.
      formatted : bool, optional
          If True return the topics as a list of strings, False as lists of
          (word, weight) pairs.
      num_words : int, optional
          DEPRECATED, USE `topn` INSTEAD.
  
      Returns
      -------
      list of (str, numpy.float) **or** list of str
          Output format for terms from a single topic depends on the value of `self.style` attribute.
  
      """
      if num_words is not None:  # deprecated num_words is used
          warnings.warn(
              "The parameter `num_words` is deprecated, will be removed in 4.0.0, please use `topn` instead."
          )
          topn = num_words
  
      lambdak = self.data[topic_id, :]
      lambdak = lambdak / lambdak.sum()
  
      temp = zip(lambdak, range(len(lambdak)))
      temp = sorted(temp, key=lambda x: x[0], reverse=True)
  
      topic_terms = self.show_topic_terms(temp, topn)
  
      if formatted:
          topic = self.format_topic(topic_id, topic_terms)
  
          # assuming we only output formatted topics
          if log:
              logger.info(topic)
      else:
          topic = (topic_id, topic_terms)
  
      # we only return the topic_terms
      return topic[1]
  
imports: import logging
  import time
  import warnings
  import numpy
  from scipy.special import gammaln, psi
  from gensim import interfaces, utils, matutils
  from gensim.matutils import dirichlet_expectation, mean_absolute_difference
  from gensim.models import basemodel, ldamodel
  from gensim.utils import deprecated
label_desc: Use image node_id 5 for calling the HdpTopicFormatter obj's underlying member method code with example usage: obj.show_topic(topic_id, topn, log, formatted, num_words) and returns: topic