class_docstr: Permute provide a random [n] -> [n] permute operation.
  e.g, a [3] -> [3] permute operation could be:
  [0,1,2] -> [1,0,2], "010" => "100"
docstr: Init a Permute object. Randomly generate a mapping, e.g. [0,1,2] -> [1,0,2]
docstr_tok: ["Init","a","Permute","object",".","Randomly","generate","a","mapping",",","e.g",".","[","0,1,2","]","-",">","[","1,0,2","]"]
code: def __init__(self, n):
      """
      Init a Permute object. Randomly generate a mapping, e.g. [0,1,2] -> [1,0,2]
      """
      m = list(range(n))
      for end in xrange(n - 1, 0, -1):
          r = random.randint(0, end)
          tmp = m[end]
          m[end] = m[r]
          m[r] = tmp
      self.mapping = m
  
imports: import random
  from bisect import bisect_left
label_desc: Use image node_id 1 to create a new Permute object  with example: obj = Permute(n)