code: def test_extensions_match(doc_en, ext_name, ext_type, kwargs):
      textacy.set_doc_extensions("text_stats")
      ext = getattr(doc_en._, ext_name)
      if ext_type == "property":
          func = textacy.get_doc_extensions("text_stats")[ext_name][
              "getter"
          ]
          ext_val = ext
          func_val = func(doc_en)
      if ext_type == "method":
          func = textacy.get_doc_extensions("text_stats")[ext_name][
              "method"
          ]
          ext_val = ext(**kwargs)
          func_val = func(doc_en, **kwargs)
      assert ext_val == func_val
      textacy.remove_doc_extensions("text_stats")
  
imports: import pytest
  import textacy
  from textacy import text_stats
label_desc: Use image node_id 2 for calling a global function with example usage: test_extensions_match(doc_en, ext_name, ext_type, kwargs) without return types