``if self.sample >= 1000 and self.cpu_count > 1:`` 1000 should replaced by a class variable.
if self.sample >= 1000 and self.cpu_count > 1:1000 should replaced by a class variable.