code: def test_invalid_weighting(self, weighting, doc_en):
      with pytest.raises(ValueError):
          _ = extract.to_bag_of_terms(
              doc_en, weighting=weighting, ngs=2
          )
  
file_path: textacy/tests/extract/test_bags.py
imports: import pytest
  import spacy
  from textacy import extract
label_desc: Use image node_id 6 for calling the TestBagOfTerms obj's underlying member method code with example usage: obj.test_invalid_weighting(weighting, doc_en) without return types