code: def test_basics_attrs(
      ts_en, ts_es, lang, attr_name, attr_type, attr_subtype, exp_val
  ):
      # NOTE: this is awkward, and it seems like there should be a better way
      ts = ts_en if lang == "en" else ts_es
      assert hasattr(ts, attr_name)
      obs_val = getattr(ts, attr_name)
      assert isinstance(obs_val, attr_type)
      if attr_subtype is not None:
          assert all(isinstance(ov, attr_subtype) for ov in obs_val)
      if exp_val is not None:
          if attr_type is float:
              assert obs_val == pytest.approx(exp_val, rel=1e-2)
          else:
              assert obs_val == exp_val
  
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 3 for calling a global function with example usage: test_basics_attrs(ts_en, ts_es, lang, attr_name, attr_type, attr_subtype, exp_val) without return types