code: def getNextSample(self, V):
          
  
          positions = range(0, len(self.wmg))
          randPoss = random.sample(positions, self.shuffleSize)
          flipSet = copy.deepcopy(randPoss)
          randPoss.sort()
          W = copy.deepcopy(V)
          for j in range(0, self.shuffleSize):
              W[randPoss[j]] = V[flipSet[j]]
  
          # Check whether we should change to the new ranking.
          prMW = 1.0
          prMV = 1.0
          acceptanceRatio = self.calcAcceptanceRatio(V, W)
          prob = min(1.0,(prMW/prMV)*acceptanceRatio)
          if random.random() <= prob:
              V = W
          return V
docs: Generate the next sample by randomly shuffling candidates.
  
          :ivar list<int> V: Contains integer representations of each candidate in order of their
              ranking in a vote, from first to last. This is the current sample.