code: def test_diversity_method(ts_en, method_name, kwargs, exp_val):
      assert ts_en.diversity(method_name, **kwargs) == pytest.approx(
          exp_val, rel=0.05
      )
  
file_path: textacy/tests/text_stats/test_api.py
imports: import collections
  from contextlib import nullcontext
  import pyphen
  import pytest
  import textacy
  import textacy.text_stats
label_desc: Use image node_id 6 for calling a global function with example usage: test_diversity_method(ts_en, method_name, kwargs, exp_val) without return types