code: def test_pairwise():
      nodes = range(4)
      node_pairs = [(0, 1), (1, 2), (2, 3)]
      node_pairs_cycle = node_pairs + [(3, 0)]
      assert list(pairwise(nodes)) == node_pairs
      assert list(pairwise(iter(nodes))) == node_pairs
      assert list(pairwise(nodes, cyclic=True)) == node_pairs_cycle
      empty_iter = iter(())
      assert list(pairwise(empty_iter)) == []
      empty_iter = iter(())
      assert list(pairwise(empty_iter, cyclic=True)) == []
  
imports: import random
  from copy import copy
  import pytest
  import networkx
  from networkx.utils import PythonRandomInterface, arbitrary_element, create_py_random_state, create_random_state, dict_to_numpy_array, discrete_sequence, flatten, groups, make_list_of_ints, pairwise, powerlaw_sequence
  from networkx.utils.misc import _dict_to_numpy_array1, _dict_to_numpy_array2
label_desc: Use image node_id 4 for calling a global function with example usage: test_pairwise() without return types