code: def test1(comment, unranker, ranker):
      n, samplesize, n2 = 3, 4, 12
      print(comment)
      perms = []
      for r in range(fact(n)):
          pi = identity_perm(n)
          perm = unranker(n, r, pi)
          perms.append((r, perm))
      for r, pi in perms:
          pi1 = init_pi1(n, pi)
          print(
              "  From rank %s to %s back to %s"
              % (r, pi, ranker(n, pi[:], pi1))
          )
      print(
          "\n  %s random individual samples of %s items:"
          % (samplesize, n2)
      )
      for r in get_random_ranks(n2, samplesize):
          pi = identity_perm(n2)
          print(
              "    " + " ".join("%s" % i for i in unranker(n2, r, pi))
          )
      print("")
  
file_path: pythran/pythran/tests/rosetta/permutation_rank.py
imports: from math import factorial
  from random import randrange
label_desc: Use image node_id 8 for calling a global function with example usage: test1(comment, unranker, ranker) without return types