code: def test_text_stats_functionality(doc):
      ts = TextStats(doc)
  
      for attr in ["n_words", "n_syllables", "n_chars"]:
          assert hasattr(ts, attr)
          assert isinstance(getattr(ts, attr), int)
  
      assert hasattr(ts, "entropy")
      assert isinstance(ts.entropy, float)
  
      assert hasattr(ts, "readability")
      assert isinstance(
          ts.readability("flesch-kincaid-grade-level"), float
      )
  
      assert hasattr(ts, "diversity")
      assert isinstance(ts.diversity("ttr"), float)
  
imports: import numpy
  import pytest
  import scipy.sparse
  from spacy.tokens import Doc, Span
  import textacy.datasets
  from textacy import Corpus
  from textacy import extract, preprocessing
  from textacy import load_spacy_lang, make_spacy_doc
  from textacy.extract import keyterms
  from textacy.text_stats import TextStats
  from textacy.tm import TopicModel
  from textacy.representations import Vectorizer
label_desc: Use image node_id 9 for calling a global function with example usage: test_text_stats_functionality(doc) without return types