code: def test_fewer_than_4_nodes():
      G = nx.DiGraph()
      G.add_nodes_from([0, 1, 2])
      with pytest.raises(
          nx.NetworkXError, match=".*fewer than four nodes."
      ):
          nx.directed_edge_swap(G)
  
imports: import pytest
  import networkx
label_desc: Use image node_id 20 for calling a global function with example usage: test_fewer_than_4_nodes() without return types