code: def test_by_invalid(self, by, term_spans):
      with pytest.raises(ValueError):
          _ = list(utils.terms_to_strings(term_spans, by))
  
file_path: textacy/tests/extract/test_extract_utils.py
imports: import pytest
  import textacy
  from textacy.extract import utils
label_desc: Use image node_id 5 for calling the TestTermsToStrings obj's underlying member method code with example usage: obj.test_by_invalid(by, term_spans) without return types