





import math


def  SCREAMING_SNAKE_CASE   ( _UpperCAmelCase				)    ->  bool:

    if 1 < number < 4:
        # 2 and 3 are primes
        return True
    elif number < 2 or number % 2 == 0 or number % 3 == 0:
        # Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
        return False

    # All primes number are in format of 6k +/- 1
    for i in range(5		,			int(math.sqrt(_UpperCAmelCase				) + 1				)		,			6				):
        if number % i == 0 or number % (i + 2) == 0:
            return False
    return True


def  SCREAMING_SNAKE_CASE   ( _UpperCAmelCase = 0.1				)    ->  int:
    lowerCamelCase__					:   Tuple      				=	3
    lowerCamelCase__					:   Optional[int]      				=	3

    while primes / (2 * j - 1) >= ratio:
        for i in range(j * j + j + 1		,			(j + 2) * (j + 2)		,			j + 1				):
            primes += is_prime(_UpperCAmelCase				)
        j += 2
    return j


if __name__ == "__main__":
    import doctest

    doctest.testmod()












from ...configuration_utils import PretrainedConfig
from ...utils import logging


_UpperCAmelCase       : Dict			     =       logging.get_logger(__name__)

_UpperCAmelCase       : Union[str, Any]			     =       {
    """naver-clova-ix/donut-base""": """https://huggingface.co/naver-clova-ix/donut-base/resolve/main/config.json""",
    # See all Donut models at https://huggingface.co/models?filter=donut-swin
}

class      lowerCAmelCase							(      __UpperCamelCase    ):
 UpperCAmelCase__									=	"""donut-swin"""

 UpperCAmelCase__									=	{
     """num_attention_heads""": """num_heads""",
     """num_hidden_layers""": """num_layers""",
 }
 def __init__(   self						:   Tuple    ,  UpperCAmelCase						:   List[str]=224    ,  UpperCAmelCase						:   Optional[Any]=4    ,  UpperCAmelCase						:   Union[str, Any]=3    ,  UpperCAmelCase						:   Union[str, Any]=96    ,  UpperCAmelCase						:   int=[2, 2, 6, 2]    ,  UpperCAmelCase						:   Dict=[3, 6, 12, 24]    ,  UpperCAmelCase						:   Any=7    ,  UpperCAmelCase						:   Optional[int]=4.0    ,  UpperCAmelCase						:   List[Any]=True    ,  UpperCAmelCase						:   Any=0.0    ,  UpperCAmelCase						:   Optional[Any]=0.0    ,  UpperCAmelCase						:   int=0.1    ,  UpperCAmelCase						:   List[str]="gelu"    ,  UpperCAmelCase						:   List[str]=False    ,  UpperCAmelCase						:   str=0.0_2    ,  UpperCAmelCase						:   str=1e-5    ,  **UpperCAmelCase						:   Tuple    ,  )    ->			int:
     super().__init__(**UpperCAmelCase			)

     lowerCamelCase__					:   Optional[Any]      				=	image_size
     lowerCamelCase__					:   Optional[int]      				=	patch_size
     lowerCamelCase__					:   int      				=	num_channels
     lowerCamelCase__					:   int      				=	embed_dim
     lowerCamelCase__					:   Optional[Any]      				=	depths
     lowerCamelCase__					:   Optional[int]      				=	len(UpperCAmelCase			)
     lowerCamelCase__					:   Optional[int]      				=	num_heads
     lowerCamelCase__					:   Tuple      				=	window_size
     lowerCamelCase__					:   Dict      				=	mlp_ratio
     lowerCamelCase__					:   str      				=	qkv_bias
     lowerCamelCase__					:   Tuple      				=	hidden_dropout_prob
     lowerCamelCase__					:   str      				=	attention_probs_dropout_prob
     lowerCamelCase__					:   str      				=	drop_path_rate
     lowerCamelCase__					:   int      				=	hidden_act
     lowerCamelCase__					:   str      				=	use_absolute_embeddings
     lowerCamelCase__					:   List[Any]      				=	layer_norm_eps
     lowerCamelCase__					:   Optional[Any]      				=	initializer_range
     # we set the hidden_size attribute in order to make Swin work with VisionEncoderDecoderModel
     # this indicates the channel dimension after the last stage of the model
     lowerCamelCase__					:   Optional[int]      				=	int(embed_dim * 2 ** (len(UpperCAmelCase			) - 1)			)





