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: Format the display for a single topic in two different ways.
  
  Parameters
  ----------
  topic_id : int
      Acts as a representative index for a particular topic.
  topic_terms : list of (str, numpy.float)
      Contains the most probable words from a single topic.
  
  Returns
  -------
  list of (str, numpy.float) **or** list of str
      Output format for topic terms depends on the value of `self.style` attribute.
code: def format_topic(self, topic_id, topic_terms):
      """Format the display for a single topic in two different ways.
  
      Parameters
      ----------
      topic_id : int
          Acts as a representative index for a particular topic.
      topic_terms : list of (str, numpy.float)
          Contains the most probable words from a single topic.
  
      Returns
      -------
      list of (str, numpy.float) **or** list of str
          Output format for topic terms depends on the value of `self.style` attribute.
  
      """
      if self.STYLE_GENSIM == self.style:
          fmt = " + ".join(
              "%.3f*%s" % (weight, word)
              for (word, weight) in topic_terms
          )
      else:
          fmt = "\n".join(
              "    %20s    %.8f" % (word, weight)
              for (word, weight) in topic_terms
          )
  
      fmt = (topic_id, fmt)
      return fmt
  
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 7 for calling the HdpTopicFormatter obj's underlying member method code with example usage: obj.format_topic(topic_id, topic_terms) and returns: fmt