


'''simple docstring'''







from itertools import compress, repeat
from math import ceil, sqrt






def    lowerCAmelCase__ (       lowerCamelCase  :    int     ):

       if num <= 2:
              return []
       if num == 3:
              return [2]

       # Odd sieve for numbers in range [3, num - 1]
       _A  :			Tuple											=      bytearray(b'\x01'     ) * ((num >> 1) - 1)

       for i in range(3						,int(sqrt(lowerCamelCase     )     ) + 1						,2     ):
              if sieve[(i >> 1) - 1]:
                     _A  :			Union[str, Any]											=      i**2
                     _A  :			Any											=      repeat(
                         0						,ceil((num - i_squared) / (i << 1)     )     )

       return [2] + list(compress(range(3						,lowerCamelCase						,2     )						,lowerCamelCase     )     )


if __name__ == "__main__":
   import doctest

   doctest.testmod()










'''simple docstring'''







from unittest.mock import patch

import datasets
from datasets import Dataset






def    lowerCAmelCase__ (       ):
       _A  :			Optional[int]											=      Dataset.from_dict({'col_1': [3, 2, 0, 1]}     )

       with patch('tqdm.auto.tqdm'     ) as mock_tqdm:
              datasets.disable_progress_bar()
              dset.map(lambda lowerCamelCase     : {"col_2": x["col_1"] + 1}     )
              mock_tqdm.assert_not_called()

              mock_tqdm.reset_mock()

              datasets.enable_progress_bar()
              dset.map(lambda lowerCamelCase     : {"col_2": x["col_1"] + 1}     )
              mock_tqdm.assert_called()






