code: def get_corpus_dictionary():
      """Crafts a toy corpus and the dictionary associated."""
      corpus = [
          ["carrot", "salad", "tomato"],
          ["carrot", "salad", "dish"],
          ["tomato", "dish"],
          ["tomato", "salad"],
          ["car", "break", "highway"],
          ["highway", "accident", "car"],
          ["moto", "break"],
          ["accident", "moto", "car"],
      ]
      dictionary = Dictionary(corpus)
  
      # Transforming corpus with dictionary.
      corpus = [dictionary.doc2bow(doc) for doc in corpus]
  
      # Building reverse index.
      for token, uid in dictionary.token2id.items():
          dictionary.id2token[uid] = token
  
      return corpus, dictionary
  
file_path: pyLDAvis/tests/pyLDAvis/test_gensim_models.py
imports: import os
  from gensim.models import LdaModel, HdpModel
  from gensim.corpora.dictionary import Dictionary
  import pyLDAvis
  import pyLDAvis.gensim_models
label_desc: Use image node_id 1 for calling a global function with example usage: get_corpus_dictionary() and returns: corpus,  dictionary