code: def test_word_counts(self, corpus):
      abs_counts = corpus.word_counts(weighting="count", by="lower")
      rel_counts = corpus.word_counts(weighting="freq", by="lower")
      assert isinstance(abs_counts, dict)
      assert all(
          isinstance(count, int) for count in abs_counts.values()
      )
      assert min(abs_counts.values()) > 0
      assert isinstance(rel_counts, dict)
      assert all(
          isinstance(count, float) for count in rel_counts.values()
      )
      assert (
          min(rel_counts.values()) > 0 and max(rel_counts.values()) <= 1
      )
  
imports: import collections
  import itertools
  import numpy
  import pytest
  from spacy.tokens import Doc
  from textacy import Corpus
  from textacy import load_spacy_lang
label_desc: Use image node_id 7 for calling the TestCorpusMethods obj's underlying member method code with example usage: obj.test_word_counts(corpus) without return types