code: def test_inject_metadata_term_lists(self):
      tdm = build_hamlet_jz_term_doc_mat()
      scatter_chart = ScatterChart(
          term_doc_matrix=tdm, minimum_term_frequency=0
      )
      with self.assertRaises(TermDocMatrixHasNoMetadataException):
          scatter_chart.inject_metadata_term_lists(
              {"blah": ["a", "adsf", "asfd"]}
          )
      scatter_chart = ScatterChart(
          term_doc_matrix=build_hamlet_jz_corpus_with_meta(),
          minimum_term_frequency=0,
          use_non_text_features=True,
      )
  
      with self.assertRaises(TypeError):
          scatter_chart.inject_metadata_term_lists({"blash": [3, 1]})
      with self.assertRaises(TypeError):
          scatter_chart.inject_metadata_term_lists({3: ["a", "b"]})
      with self.assertRaises(TypeError):
          scatter_chart.inject_metadata_term_lists({"a": {"a", "b"}})
      with self.assertRaises(TypeError):
          scatter_chart.inject_metadata_term_lists(3)
      self.assertEqual(
          type(
              scatter_chart.inject_metadata_term_lists(
                  {"a": ["a", "b"]}
              )
          ),
          ScatterChart,
      )
      j = scatter_chart.to_dict("hamlet")
      self.assertEqual(
          set(j.keys()), set(["info", "data", "metalists"])
      )
      self.assertEqual(
          set(j["info"].keys()),
          set(
              [
                  "not_category_name",
                  "category_name",
                  "category_terms",
                  "not_category_terms",
                  "category_internal_name",
                  "not_category_internal_names",
                  "extra_category_internal_names",
                  "neutral_category_internal_names",
                  "categories",
              ]
          ),
      )
  
imports: import sys
  from unittest import TestCase
  import numpy
  import pandas
  from scattertext import LogOddsRatioUninformativeDirichletPrior, scale
  from scattertext import ScatterChart
  from scattertext.ScatterChart import CoordinatesNotRightException, TermDocMatrixHasNoMetadataException, NeedToInjectCoordinatesException
  from scattertext.test.test_corpusFromPandasWithoutCategories import get_term_doc_matrix_without_categories
  from scattertext.test.test_semioticSquare import get_test_corpus
  from scattertext.test.test_termDocMatrixFactory import build_hamlet_jz_term_doc_mat, build_hamlet_jz_corpus_with_meta
label_desc: Use image node_id 11 for calling the TestScatterChart obj's underlying member method code with example usage: obj.test_inject_metadata_term_lists() without return types