code: def test_keywords(self, text, keyword, ignore_case):
      obs = list(
          extract.keyword_in_context(
              text,
              keyword,
              ignore_case=ignore_case,
          )
      )
      if isinstance(keyword, str):
          assert all(
              re.match(
                  keyword,
                  kw,
                  flags=0 if ignore_case is False else re.IGNORECASE,
              )
              for _, kw, _ in obs
          )
      else:
          assert all(re.match(keyword, kw) for _, kw, _ in obs)
  
file_path: textacy/tests/extract/test_kwic.py
imports: import re
  import pytest
  import textacy
  from textacy import extract
label_desc: Use image node_id 2 for calling the TestKeywordInContext obj's underlying member method code with example usage: obj.test_keywords(text, keyword, ignore_case) without return types