code: def test_weighted_spans_word_bigrams():
      doc = "I see: a leaning lemon tree"
      vec = CountVectorizer(analyzer="word", ngram_range=(1, 2))
      vec.fit([doc])
      w_spans = get_weighted_spans(
          doc,
          vec,
          FeatureWeights(
              pos=[
                  FW("see", 2),
                  FW("leaning lemon", 5),
                  FW("lemon tree", 8),
              ],
              neg=[FW("tree", -6)],
          ),
      )
      assert w_spans == WeightedSpans(
          [
              DocWeightedSpans(
                  document="i see: a leaning lemon tree",
                  spans=[
                      ("see", [(2, 5)], 2),
                      ("tree", [(23, 27)], -6),
                      ("leaning lemon", [(9, 16), (17, 22)], 5),
                      ("lemon tree", [(17, 22), (23, 27)], 8),
                  ],
                  preserve_density=False,
              )
          ],
          other=FeatureWeights(
              pos=[FW(hl_in_text, 9)],
              neg=[],
          ),
      )
  
file_path: eli5/tests/test_sklearn_text.py
imports: from sklearn.feature_extraction.text import CountVectorizer
  from sklearn.pipeline import FeatureUnion
  from eli5.base import DocWeightedSpans, WeightedSpans, FeatureWeights, FeatureWeight
  from eli5.formatters import FormattedFeatureName
  from eli5.sklearn.text import get_weighted_spans
label_desc: Use image node_id 2 for calling a global function with example usage: test_weighted_spans_word_bigrams() without return types