code: def test_mtld(mtld_doc, min_ttr, exp_val):
      obs_val = diversity.mtld(mtld_doc, min_ttr=min_ttr)
      assert obs_val == pytest.approx(exp_val, rel=1e-2)
  
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 7 for calling a global function with example usage: test_mtld(mtld_doc, min_ttr, exp_val) without return types