code: def unranker1(n, r, pi):
      while n > 0:
          n1, (rdivn, rmodn) = n - 1, divmod(r, n)
          pi[n1], pi[rmodn] = pi[rmodn], pi[n1]
          n = n1
          r = rdivn
      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 2 for calling a global function with example usage: unranker1(n, r, pi) and returns: pi