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: Permute the bitarray ba inplace.
docstr_tok: ["Permute","the","bitarray","ba","inplace","."]
code: def permute(self, ba):
      """
      Permute the bitarray ba inplace.
      """
      c = ba.copy()
      for i in xrange(len(self.mapping)):
          ba[i] = c[self.mapping[i]]
      return ba
  
imports: import random
  from bisect import bisect_left
label_desc: Use image node_id 2 for calling the Permute obj's underlying member method code with example usage: obj.permute(ba) and returns: ba