code: def test_directed():
      with pytest.raises(nx.NetworkXNotImplemented):
          G = nx.gnp_random_graph(10, 0.4, directed=True)
          kc = k_components(G)
  
imports: import pytest
  import networkx
  from networkx.algorithms.approximation import k_components
  from networkx.algorithms.approximation.kcomponents import _AntiGraph, _same
label_desc: Use image node_id 10 for calling a global function with example usage: test_directed() without return types