code: def permutationDFS(source, start, res):
      # get permutations with DFS
      # return order in [[1, 2], [2, 1]] or
      # [[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 2, 1], [3, 1, 2]]
      if start == len(source) - 1:  # reach final state
          res.append(source.tolist())
      for i in range(start, len(source)):
          # swap values at position start and i
          source[start], source[i] = source[i], source[start]
          permutationDFS(source, start + 1, res)
          # reverse the swap
          source[start], source[i] = source[i], source[start]
  
file_path: espnet/utils/eval_perm_free_error.py
imports: import argparse
  import codecs
  import json
  import logging
  import re
  import sys
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: permutationDFS(source, start, res) without return types