

"""simple docstring"""





def   __SCREAMING_SNAKE_CASE  (      A_ = 10_00 ):
	return sum(e for e in range(3						,     A_ ) if e % 3 == 0 or e % 5 == 0 )


if __name__ == "__main__":
							print(F'''{solution() = }''')





"""simple docstring"""




from __future__ import annotations

import unittest

from transformers import is_tf_available
from transformers.testing_utils import require_tf, slow

from ...test_configuration_common import ConfigTester
from ...test_modeling_tf_common import TFModelTesterMixin, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_tf_available():
				import numpy
				import tensorflow as tf

				from transformers import (
				    TF_DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST,
				    TF_DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST,
				    TF_DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST,
				    BertConfig,
				    DPRConfig,
				    TFDPRContextEncoder,
				    TFDPRQuestionEncoder,
				    TFDPRReader,
				)
class 			UpperCamelCase__:





						def __init__(				self						,__UpperCAmelCase						,__UpperCAmelCase=13						,__UpperCAmelCase=7						,__UpperCAmelCase=True						,__UpperCAmelCase=True						,__UpperCAmelCase=True						,__UpperCAmelCase=True						,__UpperCAmelCase=99						,__UpperCAmelCase=32						,__UpperCAmelCase=2						,__UpperCAmelCase=4						,__UpperCAmelCase=37						,__UpperCAmelCase="gelu"						,__UpperCAmelCase=0.1						,__UpperCAmelCase=0.1						,__UpperCAmelCase=5_12						,__UpperCAmelCase=16						,__UpperCAmelCase=2						,__UpperCAmelCase=0.0_2						,__UpperCAmelCase=3						,__UpperCAmelCase=4						,__UpperCAmelCase=None						,__UpperCAmelCase=0						,)    -> Dict:
													A__		   =							parent
													A__		   =							batch_size
													A__		   =							seq_length
													A__		   =							is_training
													A__		   =							use_input_mask
													A__		   =							use_token_type_ids
													A__		   =							use_labels
													A__		   =							vocab_size
													A__		   =							hidden_size
													A__		   =							num_hidden_layers
													A__		   =							num_attention_heads
													A__		   =							intermediate_size
													A__		   =							hidden_act
													A__		   =							hidden_dropout_prob
													A__		   =							attention_probs_dropout_prob
													A__		   =							max_position_embeddings
													A__		   =							type_vocab_size
													A__		   =							type_sequence_label_size
													A__		   =							initializer_range
													A__		   =							num_labels
													A__		   =							num_choices
													A__		   =							scope
													A__		   =							projection_dim





						def  snake_case__		(				self   )    -> Optional[Any]:
													A__		   =							ids_tensor([self.batch_size, self.seq_length]						,self.vocab_size   )

													A__		   =							None
													if self.use_input_mask:
																				# follow test_modeling_tf_ctrl.py
																				A__		   =							random_attention_mask([self.batch_size, self.seq_length]   )

													A__		   =							None
													if self.use_token_type_ids:
																				A__		   =							ids_tensor([self.batch_size, self.seq_length]						,self.type_vocab_size   )

													A__		   =							None
													A__		   =							None
													A__		   =							None
													if self.use_labels:
																				A__		   =							ids_tensor([self.batch_size]						,self.type_sequence_label_size   )
																				A__		   =							ids_tensor([self.batch_size, self.seq_length]						,self.num_labels   )
																				A__		   =							ids_tensor([self.batch_size]						,self.num_choices   )

													A__		   =							BertConfig(
													    vocab_size=self.vocab_size						,hidden_size=self.hidden_size						,num_hidden_layers=self.num_hidden_layers						,num_attention_heads=self.num_attention_heads						,intermediate_size=self.intermediate_size						,hidden_act=self.hidden_act						,hidden_dropout_prob=self.hidden_dropout_prob						,attention_probs_dropout_prob=self.attention_probs_dropout_prob						,max_position_embeddings=self.max_position_embeddings						,type_vocab_size=self.type_vocab_size						,is_decoder=__UpperCAmelCase						,initializer_range=self.initializer_range						,)
													A__		   =							DPRConfig(projection_dim=self.projection_dim						,**config.to_dict()   )

													return config, input_ids, token_type_ids, input_mask, sequence_labels, token_labels, choice_labels





						def  snake_case__		(				self						,__UpperCAmelCase						,__UpperCAmelCase						,__UpperCAmelCase						,__UpperCAmelCase						,__UpperCAmelCase						,__UpperCAmelCase						,__UpperCAmelCase   )    -> Tuple:
													A__		   =							TFDPRContextEncoder(config=__UpperCAmelCase   )
													A__		   =							model(__UpperCAmelCase						,attention_mask=__UpperCAmelCase						,token_type_ids=__UpperCAmelCase   )
													A__		   =							model(__UpperCAmelCase						,token_type_ids=__UpperCAmelCase   )
													A__		   =							model(__UpperCAmelCase   )
													self.parent.assertEqual(result.pooler_output.shape						,(self.batch_size, self.projection_dim or self.hidden_size)   )





						def  snake_case__		(				self						,__UpperCAmelCase						,__UpperCAmelCase						,__UpperCAmelCase						,__UpperCAmelCase						,__UpperCAmelCase						,__UpperCAmelCase						,__UpperCAmelCase   )    -> Union[str, Any]:
													A__		   =							TFDPRQuestionEncoder(config=__UpperCAmelCase   )
													A__		   =							model(__UpperCAmelCase						,attention_mask=__UpperCAmelCase						,token_type_ids=__UpperCAmelCase   )
													A__		   =							model(__UpperCAmelCase						,token_type_ids=__UpperCAmelCase   )
													A__		   =							model(__UpperCAmelCase   )
													self.parent.assertEqual(result.pooler_output.shape						,(self.batch_size, self.projection_dim or self.hidden_size)   )





						def  snake_case__		(				self						,__UpperCAmelCase						,__UpperCAmelCase						,__UpperCAmelCase						,__UpperCAmelCase						,__UpperCAmelCase						,__UpperCAmelCase						,__UpperCAmelCase   )    -> Optional[int]:
													A__		   =							TFDPRReader(config=__UpperCAmelCase   )
													A__		   =							model(__UpperCAmelCase						,attention_mask=__UpperCAmelCase   )

													self.parent.assertEqual(result.start_logits.shape						,(self.batch_size, self.seq_length)   )
													self.parent.assertEqual(result.end_logits.shape						,(self.batch_size, self.seq_length)   )
													self.parent.assertEqual(result.relevance_logits.shape						,(self.batch_size,)   )





						def  snake_case__		(				self   )    -> int:
													A__		   =							self.prepare_config_and_inputs()
													(
													    (
													    A__
													)   ,     (
													    A__
													)   ,     (
													    A__
													)   ,     (
													    A__
													)   ,     (
													    A__
													)   ,     (
													    A__
													)   ,     (
													    A__
													)   ,     
													)		   =							config_and_inputs
													A__		   =							{'input_ids': input_ids}
													return config, inputs_dict






@require_tf
class 			UpperCamelCase__(	__A						,  __A						,  unittest.TestCase       ):
						lowerCAmelCase__     :  Optional[int]  							=						(
						    (
						        TFDPRContextEncoder,
						        TFDPRQuestionEncoder,
						        TFDPRReader,
						    )
						    if is_tf_available()
						    else ()
						)
						lowerCAmelCase__     :  List[str]  							=						{'feature-extraction': TFDPRQuestionEncoder} if is_tf_available() else {}

						lowerCAmelCase__     :  Tuple  							=						False
						lowerCAmelCase__     :  Optional[int]  							=						False
						lowerCAmelCase__     :  List[str]  							=						False
						lowerCAmelCase__     :  int  							=						False
						lowerCAmelCase__     :  str  							=						False





						def  snake_case__		(				self   )    -> str:
													A__		   =							TFDPRModelTester(self   )
													A__		   =							ConfigTester(self						,config_class=__UpperCAmelCase						,hidden_size=37   )





						def  snake_case__		(				self   )    -> Optional[Any]:
													self.config_tester.run_common_tests()





						def  snake_case__		(				self   )    -> int:
													A__		   =							self.model_tester.prepare_config_and_inputs()
													self.model_tester.create_and_check_dpr_context_encoder(*__UpperCAmelCase   )





						def  snake_case__		(				self   )    -> Optional[Any]:
													A__		   =							self.model_tester.prepare_config_and_inputs()
													self.model_tester.create_and_check_dpr_question_encoder(*__UpperCAmelCase   )





						def  snake_case__		(				self   )    -> List[str]:
													A__		   =							self.model_tester.prepare_config_and_inputs()
													self.model_tester.create_and_check_dpr_reader(*__UpperCAmelCase   )





						@slow
						def  snake_case__		(				self   )    -> int:
													for model_name in TF_DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
																				A__		   =							TFDPRContextEncoder.from_pretrained(__UpperCAmelCase   )
																				self.assertIsNotNone(__UpperCAmelCase   )

													for model_name in TF_DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
																				A__		   =							TFDPRContextEncoder.from_pretrained(__UpperCAmelCase   )
																				self.assertIsNotNone(__UpperCAmelCase   )

													for model_name in TF_DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
																				A__		   =							TFDPRQuestionEncoder.from_pretrained(__UpperCAmelCase   )
																				self.assertIsNotNone(__UpperCAmelCase   )

													for model_name in TF_DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
																				A__		   =							TFDPRReader.from_pretrained(__UpperCAmelCase   )
																				self.assertIsNotNone(__UpperCAmelCase   )






@require_tf
class 			UpperCamelCase__(	unittest.TestCase       ):





						@slow
						def  snake_case__		(				self   )    -> Optional[Any]:
													A__		   =							TFDPRQuestionEncoder.from_pretrained('facebook/dpr-question_encoder-single-nq-base'   )

													A__		   =							tf.constant(
													    [[1_01, 75_92, 10_10, 20_03, 20_26, 38_99, 1_01_40, 10_29, 1_02]]   )  # [CLS] hello, is my dog cute? [SEP]
													A__		   =							model(__UpperCAmelCase   )[0]  # embedding shape = (1, 768)
													# compare the actual values for a slice.
													A__		   =							tf.constant(
													    [
													        [
													            0.0_3_2_3_6_2_5_3,
													            0.1_2_7_5_3_3_3_5,
													            0.1_6_8_1_8_5_0_9,
													            0.0_0_2_7_9_7_8_6,
													            0.3_8_9_6_9_3_3,
													            0.2_4_2_6_4_9_4_5,
													            0.2_1_7_8_9_7_1,
													            -0.0_2_3_3_5_2_2_7,
													            -0.0_8_4_8_1_9_5_9,
													            -0.1_4_3_2_4_1_1_7,
													        ]
													    ]   )
													self.assertTrue(numpy.allclose(output[:, :10].numpy()						,expected_slice.numpy()						,atol=1e-4   )   )





