code: def test_edge_weighting(self, edge_weighting, docs):
      data = [tok.text for tok in docs[0]]
      graph = network.build_cooccurrence_network(
          data, edge_weighting=edge_weighting
      )
      assert len(graph) == len(set(data))
      if edge_weighting == "count":
          assert all(
              isinstance(data["weight"], int) and data["weight"] >= 1
              for _, _, data in graph.edges(data=True)
          )
      elif edge_weighting == "binary":
          assert all(
              data["weight"] == 1
              for _, _, data in graph.edges(data=True)
          )
  
file_path: textacy/tests/representations/test_network.py
imports: from cytoolz import itertoolz
  import pytest
  import textacy
  from textacy.representations import network
label_desc: Use image node_id 4 for calling the TestCooccurrenceNetwork obj's underlying member method code with example usage: obj.test_edge_weighting(edge_weighting, docs) without return types