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 from `num_topics` topics.
  
  Parameters
  ----------
  num_topics : int, optional
      Top `num_topics` to be printed.
  num_words : int, optional
      Top `num_words` most probable words to be printed from each topic.
  log : bool, optional
      If True - log a message with level INFO on the logger object.
  formatted : bool, optional
      If True - get the topics as a list of strings, otherwise as lists of (word, weight) pairs.
  
  Returns
  -------
  list of (int, list of (str, numpy.float) **or** list of str)
      Output format for terms from `num_topics` topics depends on the value of `self.style` attribute.
code: def show_topics(
      self, num_topics=10, num_words=10, log=False, formatted=True
  ):
      """Give the most probable `num_words` words from `num_topics` topics.
  
      Parameters
      ----------
      num_topics : int, optional
          Top `num_topics` to be printed.
      num_words : int, optional
          Top `num_words` most probable words to be printed from each topic.
      log : bool, optional
          If True - log a message with level INFO on the logger object.
      formatted : bool, optional
          If True - get the topics as a list of strings, otherwise as lists of (word, weight) pairs.
  
      Returns
      -------
      list of (int, list of (str, numpy.float) **or** list of str)
          Output format for terms from `num_topics` topics depends on the value of `self.style` attribute.
  
      """
      shown = []
      num_topics = max(num_topics, 0)
      num_topics = min(num_topics, len(self.data))
  
      for k in range(num_topics):
          lambdak = self.data[k, :]
          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, num_words)
  
          if formatted:
              topic = self.format_topic(k, topic_terms)
  
              # assuming we only output formatted topics
              if log:
                  logger.info(topic)
          else:
              topic = (k, topic_terms)
          shown.append(topic)
  
      return shown
  
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 3 for calling the HdpTopicFormatter obj's underlying member method code with example usage: obj.show_topics(num_topics, num_words, log, formatted) and returns: shown