code: def test_same_as_term_doc_matrix(self):
      term_doc_matrix = build_term_doc_matrix()
      corpus = self._make_political_corpus()
  
      self.assertEqual(term_doc_matrix._X.shape, corpus._X.shape)
      self.assertEqual((corpus._X != term_doc_matrix._X).nnz, 0)
      corpus_scores = corpus.get_scaled_f_scores("democrat")
      term_doc_matrix_scores = corpus.get_scaled_f_scores("democrat")
      self.assertTrue(
          np.array_equal(term_doc_matrix_scores, corpus_scores)
      )
  
imports: import json
  import os
  import pkgutil
  import re
  from unittest import TestCase
  import numpy
  import pandas
  from scattertext.ParsedCorpus import ParsedCorpus
  from scattertext.CorpusFromParsedDocuments import CorpusFromParsedDocuments
  from scattertext.WhitespaceNLP import whitespace_nlp
  from scattertext.TermDocMatrixFactory import TermDocMatrixFactory
  from scattertext.test.test_TermDocMat import get_hamlet_docs, get_hamlet_snippet_binary_category
  from scattertext.test.test_corpusFromPandas import get_docs_categories
label_desc: Use image node_id 2 for calling the TestCorpusFromParsedDocuments obj's underlying member method code with example usage: obj.test_same_as_term_doc_matrix() without return types