code: def _permutation_based(
      causal_graph: DirectedGraph,
      data: pd.DataFrame,
      methods: Union[Callable, Tuple[Callable, ...], List[Callable]],
      exclude_original_order: bool,
      n_permutations: int,
      show_progress_bar: bool,
  ) -> Dict[str, List[Union[DirectedGraph, Dict]]]:
      """
      Generate baseline for node permutations.
  
      :param causal_graph: A directed acyclic graph (DAG).
      :param methods: Validation methods to perform.
      :param exclude_original_order: Exclude the original ordering of the nodes (default=False)
      :param n_permutations: Number of permutations to perform. If -1 use all n_nodes! - int(exclude_orig) permutations
      :param show_progress_bar: Whether to show progress bar over tested permutations.
      :return: Dictionary containing summary of validation for each individual graph as well as the permuted graphs
      """
  
      if not isinstance(methods, (tuple, list)):
          methods = (methods,)
  
      perm_gen = _PermuteNodes(
          causal_graph,
          n_permutations=n_permutations,
          exclude_original_order=exclude_original_order,
      )
      validation_summary = {FalsifyConst.PERM_GRAPHS: []}
      for permuted_graph in tqdm(
          perm_gen,
          desc="Test permutations of given graph",
          disable=not show_progress_bar,
      ):
          res = run_validations(
              causal_graph=permuted_graph,
              data=data,
              methods=methods,
          )
          validation_summary[FalsifyConst.PERM_GRAPHS].append(
              permuted_graph
          )
          for m_name, summary in res.items():
              if m_name not in validation_summary:
                  validation_summary[m_name] = []
              validation_summary[m_name].append(summary)
  
      return validation_summary
  
imports: import warnings
  from dataclasses import dataclass, field
  from enum import Enum, auto
  from functools import partial
  from inspect import getfullargspec
  from itertools import permutations
  from typing import Any, Callable, Dict, FrozenSet, List, Optional, Set, Tuple, Union
  import matplotlib.colors
  import matplotlib.pyplot
  import networkx
  import numpy
  import pandas
  from joblib import Parallel, delayed
  from tqdm import tqdm
  import dowhy.gcm.config
  from dowhy.gcm.independence_test import kernel_based
  from dowhy.gcm.util import plot
  from dowhy.gcm.util.general import set_random_seed
  from dowhy.graph import DirectedGraph, get_ordered_predecessors
label_desc: Use image node_id 13 for calling a global function with example usage: _permutation_based(causal_graph, data, methods, exclude_original_order, n_permutations, show_progress_bar) and returns: validation_summary