code: def test_ispath(G):
      G.add_edges_from([(1, 2), (2, 3), (1, 2), (3, 4)])
      valid_path = [1, 2, 3, 4]
      invalid_path = [1, 2, 4, 3]  # wrong node order
      another_invalid_path = [1, 2, 3, 4, 5]  # contains node not in G
      assert nx.is_path(G, valid_path)
      assert not nx.is_path(G, invalid_path)
      assert not nx.is_path(G, another_invalid_path)
  
imports: import random
  import pytest
  import networkx
  from networkx.utils import edges_equal, nodes_equal
label_desc: Use image node_id 16 for calling a global function with example usage: test_ispath(G) without return types