code: def test_directed():
      with pytest.raises(nx.NetworkXNotImplemented):
          G = nx.gnp_random_graph(10, 0.2, directed=True, seed=42)
          nx.k_components(G)
  
file_path: networkx/networkx/algorithms/connectivity/tests/test_kcomponents.py
imports: import pytest
  import networkx
  from networkx.algorithms.connectivity.kcomponents import _consolidate, build_k_number_dict
label_desc: Use image node_id 2 for calling a global function with example usage: test_directed() without return types