from dataclasses import dataclass
from typing import Callable, Optional

import datasets







@dataclass
class        UpperCAmelCase_					(				datasets.BuilderConfig     ):
    UpperCAmelCase_      :							Optional[Callable]    			=				None
    UpperCAmelCase_      :							Optional[dict]    			=				None
    UpperCAmelCase_      :							Optional[datasets.Features]    			=				None




    def     __lowerCamelCase			(       self	: Optional[int] )						->			Optional[Any]:
      assert self.generator is not None, "generator must be specified"

      if self.gen_kwargs is None:
        a__  		=  {}







class        UpperCAmelCase_					(				datasets.GeneratorBasedBuilder     ):
    UpperCAmelCase_      :							Tuple    			=				GeneratorConfig




    def     __lowerCamelCase			(       self	: Union[str, Any] )						->			List[str]:
      return datasets.DatasetInfo(features=self.config.features )




    def     __lowerCamelCase			(       self	: Dict   ,   lowerCAmelCase	: int )						->			Dict:
      return [datasets.SplitGenerator(name=datasets.Split.TRAIN   ,   gen_kwargs=self.config.gen_kwargs )]




    def     __lowerCamelCase			(       self	: int   ,   **lowerCAmelCase	: List[str] )						->			List[str]:
      for idx, ex in enumerate(self.config.generator(**_A ) ):
        yield idx, ex






from itertools import compress, repeat
from math import ceil, sqrt
def 						snake_case__							(       __lowercase							)		->		list[int]:







						"""simple docstring"""

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

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

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

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


if __name__ == "__main__":
		import doctest

		doctest.testmod()