code: def unranker2(n, r, pi):
      while n > 0:
          n1 = n - 1
          s, rmodf = divmod(r, fact(n1))
          pi[n1], pi[s] = pi[s], pi[n1]
          n = n1
          r = rmodf
      return pi
  
file_path: pythran/pythran/tests/rosetta/permutation_rank.py
imports: from math import factorial
  from random import randrange
label_desc: Use image node_id 5 for calling a global function with example usage: unranker2(n, r, pi) and returns: pi