code: def test_hdd_reduction(ttr_doc):
      hdd = diversity.hdd(ttr_doc, sample_size=30)
      ttr = diversity.ttr(ttr_doc)
      assert hdd == pytest.approx(ttr, rel=1e-6)
  
file_path: textacy/tests/text_stats/test_diversity.py
imports: import pytest
  import textacy
  from textacy.text_stats import diversity
label_desc: Use image node_id 8 for calling a global function with example usage: test_hdd_reduction(ttr_doc) without return types