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