code: def next(self):
          
          if self.probability == 1:
              x, y = next(self.scan)
          else:
              while True:
                  x, y = next(self.scan)
                  if random.random() <= self.probability: break
          return x, y
docs: Next point in iteration