


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


__snake_case            =   logging.get_logger(__name__)

__snake_case            =   {
    "funnel-transformer/small": "https://huggingface.co/funnel-transformer/small/resolve/main/config.json",
    "funnel-transformer/small-base": "https://huggingface.co/funnel-transformer/small-base/resolve/main/config.json",
    "funnel-transformer/medium": "https://huggingface.co/funnel-transformer/medium/resolve/main/config.json",
    "funnel-transformer/medium-base": "https://huggingface.co/funnel-transformer/medium-base/resolve/main/config.json",
    "funnel-transformer/intermediate": (
        "https://huggingface.co/funnel-transformer/intermediate/resolve/main/config.json"
    ),
    "funnel-transformer/intermediate-base": (
        "https://huggingface.co/funnel-transformer/intermediate-base/resolve/main/config.json"
    ),
    "funnel-transformer/large": "https://huggingface.co/funnel-transformer/large/resolve/main/config.json",
    "funnel-transformer/large-base": "https://huggingface.co/funnel-transformer/large-base/resolve/main/config.json",
    "funnel-transformer/xlarge": "https://huggingface.co/funnel-transformer/xlarge/resolve/main/config.json",
    "funnel-transformer/xlarge-base": "https://huggingface.co/funnel-transformer/xlarge-base/resolve/main/config.json",
}




class    UpperCAmelCase					(       __snake_case    ):
			lowercase						= """funnel"""
			lowercase						= {
			    """hidden_size""": """d_model""",
			    """num_attention_heads""": """n_head""",
			}




			def __init__(						self							:		Union[str, Any]       ,       __magic_name__							:		Dict=3_0_5_2_2       ,       __magic_name__							:		List[str]=[4, 4, 4]       ,       __magic_name__							:		str=None       ,       __magic_name__							:		int=2       ,       __magic_name__							:		Any=7_6_8       ,       __magic_name__							:		Optional[Any]=1_2       ,       __magic_name__							:		Optional[int]=6_4       ,       __magic_name__							:		List[Any]=3_0_7_2       ,       __magic_name__							:		Optional[int]="gelu_new"       ,       __magic_name__							:		int=0.1       ,       __magic_name__							:		int=0.1       ,       __magic_name__							:		List[Any]=0.0       ,       __magic_name__							:		Optional[int]=0.1       ,       __magic_name__							:		Any=None       ,       __magic_name__							:		Any=1e-9       ,       __magic_name__							:		Optional[Any]="mean"       ,       __magic_name__							:		List[str]="relative_shift"       ,       __magic_name__							:		Union[str, Any]=True       ,       __magic_name__							:		Any=True       ,       __magic_name__							:		Tuple=True       ,       **__magic_name__							:		List[Any]       ,       ):







						"""simple docstring"""







						UpperCamelCase         =					vocab_size
						UpperCamelCase         =					block_sizes
						UpperCamelCase         =					[1] * len(__magic_name__						) if block_repeats is None else block_repeats
						assert len(__magic_name__						) == len(
						    self.block_repeats						), "`block_sizes` and `block_repeats` should have the same length."
						UpperCamelCase         =					num_decoder_layers
						UpperCamelCase         =					d_model
						UpperCamelCase         =					n_head
						UpperCamelCase         =					d_head
						UpperCamelCase         =					d_inner
						UpperCamelCase         =					hidden_act
						UpperCamelCase         =					hidden_dropout
						UpperCamelCase         =					attention_dropout
						UpperCamelCase         =					activation_dropout
						UpperCamelCase         =					initializer_range
						UpperCamelCase         =					initializer_std
						UpperCamelCase         =					layer_norm_eps
						assert pooling_type in [
						    "mean",
						    "max",
						], F'Got {pooling_type} for `pooling_type` but only \'mean\' and \'max\' are supported.'
						UpperCamelCase         =					pooling_type
						assert attention_type in [
						    "relative_shift",
						    "factorized",
						], F'Got {attention_type} for `attention_type` but only \'relative_shift\' and \'factorized\' are supported.'
						UpperCamelCase         =					attention_type
						UpperCamelCase         =					separate_cls
						UpperCamelCase         =					truncate_seq
						UpperCamelCase         =					pool_q_only

						super().__init__(**__magic_name__						)




			@property
			def   lowerCamelCase_					(						self							:		List[Any]						):







						"""simple docstring"""







						return sum(self.block_sizes						)




			@num_hidden_layers.setter
			def   lowerCamelCase_					(						self							:		str       ,       __magic_name__							:		Any						):







						"""simple docstring"""







						raise NotImplementedError(
						    """This model does not support the setting of `num_hidden_layers`. Please set `block_sizes`."""						)




			@property
			def   lowerCamelCase_					(						self							:		Optional[Any]						):







						"""simple docstring"""







						return len(self.block_sizes						)





			@num_blocks.setter
			def   lowerCamelCase_					(						self							:		List[str]       ,       __magic_name__							:		str						):







						"""simple docstring"""







						raise NotImplementedError("""This model does not support the setting of `num_blocks`. Please set `block_sizes`."""						)








import math






def 							_lowercase    (		SCREAMING_SNAKE_CASE_   :		int	):





			"""simple docstring"""




			UpperCamelCase         =					[True] * n
			UpperCamelCase         =					False
			UpperCamelCase         =					False
			UpperCamelCase         =					True

			for i in range(3       ,  int(n**0.5 + 1	)       ,  2	):
						UpperCamelCase         =					i * 2
						while index < n:
									UpperCamelCase         =					False
									UpperCamelCase         =					index + i

			UpperCamelCase         =					[2]

			for i in range(3       ,  SCREAMING_SNAKE_CASE_       ,  2	):
						if is_prime[i]:
									primes.append(SCREAMING_SNAKE_CASE_	)

			return primes






def 							_lowercase    (		SCREAMING_SNAKE_CASE_   :		int = 999_966_663_333	):





			"""simple docstring"""




			UpperCamelCase         =					math.floor(math.sqrt(SCREAMING_SNAKE_CASE_	)	) + 100
			UpperCamelCase         =					prime_sieve(SCREAMING_SNAKE_CASE_	)

			UpperCamelCase         =					0
			UpperCamelCase         =					0
			UpperCamelCase         =					primes[prime_index]

			while (last_prime**2) <= limit:
						UpperCamelCase         =					primes[prime_index + 1]

						UpperCamelCase         =					last_prime**2
						UpperCamelCase         =					next_prime**2

						# Get numbers divisible by lps(current)
						UpperCamelCase         =					lower_bound + last_prime
						while upper_bound > current <= limit:
									matches_sum += current
									current += last_prime

						# Reset the upper_bound
						while (upper_bound - next_prime) > limit:
									upper_bound -= next_prime

						# Add the numbers divisible by ups(current)
						UpperCamelCase         =					upper_bound - next_prime
						while current > lower_bound:
									matches_sum += current
									current -= next_prime

						# Remove the numbers divisible by both ups and lps
						UpperCamelCase         =					0
						while upper_bound > current <= limit:
									if current <= lower_bound:
												# Increment the current number
												current += last_prime * next_prime
												continue

									if current > limit:
												break

									# Remove twice since it was added by both ups and lps
									matches_sum -= current * 2

									# Increment the current number
									current += last_prime * next_prime

						# Setup for next pair
						UpperCamelCase         =					next_prime
						prime_index += 1

			return matches_sum


if __name__ == "__main__":
			print(solution())




