code: def test_given_exclude_original_order_when_generating_permutations_then_return_correct_permutations():
      num_nodes = np.random.randint(2, 10)
      perms = set()
      G = generate_random_graph(n=num_nodes)
      perm_gen = _PermuteNodes(
          G, exclude_original_order=True, n_permutations=-1
      )
      for perm in perm_gen:
          perms.add(perm)
          assert list(G.nodes) != list(perm.nodes)
  
      assert len(perms) == np.math.factorial(num_nodes) - 1
  
imports: from functools import partial
  import networkx
  import numpy
  import pandas
  import pytest
  from flaky import flaky
  from dowhy.datasets import generate_random_graph
  from dowhy.gcm.falsify import FalsifyConst, _PermuteNodes, falsify_graph, run_validations, validate_cm, validate_lmc, validate_pd, validate_tpa
  from dowhy.gcm.independence_test.generalised_cov_measure import generalised_cov_based
  from dowhy.gcm.independence_test.kernel import kernel_based
  from dowhy.gcm.ml import create_linear_regressor
  from tests.gcm.independence_test.test_kernel import _generate_categorical_data
label_desc: Use image node_id 3 for calling a global function with example usage: test_given_exclude_original_order_when_generating_permutations_then_return_correct_permutations() without return types