code: def test_k5(self):
      G = nx.complete_graph(5, create_using=nx.DiGraph())
      assert list(nx.clustering(G, weight="weight").values()) == [
          1,
          1,
          1,
          1,
          1,
      ]
      assert nx.average_clustering(G, weight="weight") == 1
      G.remove_edge(1, 2)
      assert list(nx.clustering(G, weight="weight").values()) == [
          11 / 12,
          1,
          1,
          11 / 12,
          11 / 12,
      ]
      assert nx.clustering(G, [1, 4], weight="weight") == {
          1: 1,
          4: 11 / 12,
      }
      G.remove_edge(2, 1)
      assert list(nx.clustering(G, weight="weight").values()) == [
          5 / 6,
          1,
          1,
          5 / 6,
          5 / 6,
      ]
      assert nx.clustering(G, [1, 4], weight="weight") == {
          1: 1,
          4: 0.83333333333333337,
      }
  
imports: import pytest
  import networkx
label_desc: Use image node_id 4 for calling the TestDirectedWeightedClustering obj's underlying member method code with example usage: obj.test_k5() without return types