code: def print_debug(id2token, u, s, topics, num_words=10, num_neg=None):
      """Log the most salient words per topic.
  
      Parameters
      ----------
      id2token : :class:`~gensim.corpora.dictionary.Dictionary`
          Mapping from ID to word in the Dictionary.
      u : np.ndarray
          The 2D U decomposition matrix.
      s : np.ndarray
          The 1D reduced array of eigenvalues used for decomposition.
      topics : list of int
          Sequence of topic IDs to be printed
      num_words : int, optional
          Number of words to be included for each topic.
      num_neg : int, optional
          Number of words with a negative contribution to a topic that should be included.
  
      """
      if num_neg is None:
          # by default, print half as many salient negative words as positive
          num_neg = num_words / 2
  
      logger.info(
          "computing word-topic salience for %i topics", len(topics)
      )
      topics, result = set(topics), {}
      # TODO speed up by block computation
      for uvecno, uvec in enumerate(u):
          uvec = np.abs(np.asarray(uvec).flatten())
          udiff = uvec / np.sqrt(np.sum(np.dot(uvec, uvec)))
          for topic in topics:
              result.setdefault(topic, []).append(
                  (udiff[topic], uvecno)
              )
  
      logger.debug("printing %i+%i salient words", num_words, num_neg)
      for topic in sorted(result.keys()):
          weights = sorted(result[topic], key=lambda x: -abs(x[0]))
          _, most = weights[0]
          if (
              u[most, topic] < 0.0
          ):  # the most significant word has a negative sign => flip sign of u[most]
              normalize = -1.0
          else:
              normalize = 1.0
  
          # order features according to salience; ignore near-zero entries in u
          pos, neg = [], []
          for weight, uvecno in weights:
              if normalize * u[uvecno, topic] > 0.0001:
                  pos.append(
                      "%s(%.3f)" % (id2token[uvecno], u[uvecno, topic])
                  )
                  if len(pos) >= num_words:
                      break
  
          for weight, uvecno in weights:
              if normalize * u[uvecno, topic] < -0.0001:
                  neg.append(
                      "%s(%.3f)" % (id2token[uvecno], u[uvecno, topic])
                  )
                  if len(neg) >= num_neg:
                      break
  
          logger.info(
              "topic #%s(%.3f): %s, ..., %s",
              topic,
              s[topic],
              ", ".join(pos),
              ", ".join(neg),
          )
  
imports: import logging
  import sys
  import time
  import numpy
  import scipy.linalg
  import scipy.sparse
  from scipy.sparse import sparsetools
  from gensim import interfaces, matutils, utils
  from gensim.models import basemodel
  from gensim.utils import is_empty
label_desc: Use image node_id 4 for calling a global function with example usage: print_debug(id2token, u, s, topics, num_words, num_neg) without return types