





'''simple docstring'''


import unittest

import numpy as np

from transformers import DistilBertConfig, is_flax_available
from transformers.testing_utils import require_flax, slow

from ...test_modeling_flax_common import FlaxModelTesterMixin, ids_tensor, random_attention_mask


if is_flax_available():
 import jax.numpy as jnp

 from transformers.models.distilbert.modeling_flax_distilbert import (
     FlaxDistilBertForMaskedLM,
     FlaxDistilBertForMultipleChoice,
     FlaxDistilBertForQuestionAnswering,
     FlaxDistilBertForSequenceClassification,
     FlaxDistilBertForTokenClassification,
     FlaxDistilBertModel,
 )
class 				a_       (    unittest.TestCase							):





     def __init__(			self		: Union[str, Any]     ,				lowercase		: Any     ,				lowercase		: int=13     ,				lowercase		: Dict=7     ,				lowercase		: Union[str, Any]=True     ,				lowercase		: Optional[Any]=True     ,				lowercase		: List[Any]=True     ,				lowercase		: Tuple=True     ,				lowercase		: Union[str, Any]=99     ,				lowercase		: Dict=32     ,				lowercase		: Dict=5     ,				lowercase		: str=4     ,				lowercase		: Optional[int]=37     ,				lowercase		: str="gelu"     ,				lowercase		: Any=0.1     ,				lowercase		: Optional[int]=0.1     ,				lowercase		: List[Any]=512     ,				lowercase		: Any=16     ,				lowercase		: Optional[int]=2     ,				lowercase		: str=0.02     ,				lowercase		: Union[str, Any]=4     ,				):





        """simple docstring"""




        lowercase_      :List[Any]         =			parent
        lowercase_      :Optional[int]         =			batch_size
        lowercase_      :List[Any]         =			seq_length
        lowercase_      :int         =			is_training
        lowercase_      :int         =			use_attention_mask
        lowercase_      :List[Any]         =			use_token_type_ids
        lowercase_      :Tuple         =			use_labels
        lowercase_      :Dict         =			vocab_size
        lowercase_      :Tuple         =			hidden_size
        lowercase_      :List[str]         =			num_hidden_layers
        lowercase_      :int         =			num_attention_heads
        lowercase_      :Union[str, Any]         =			intermediate_size
        lowercase_      :str         =			hidden_act
        lowercase_      :Optional[int]         =			hidden_dropout_prob
        lowercase_      :Optional[int]         =			attention_probs_dropout_prob
        lowercase_      :List[Any]         =			max_position_embeddings
        lowercase_      :Union[str, Any]         =			type_vocab_size
        lowercase_      :str         =			type_sequence_label_size
        lowercase_      :Tuple         =			initializer_range
        lowercase_      :Optional[Any]         =			num_choices





     def 							lowercase__				(			self		: Dict						):





        """simple docstring"""




        lowercase_      :int         =			ids_tensor([self.batch_size, self.seq_length]     ,				self.vocab_size						)

        lowercase_      :Optional[int]         =			None
        if self.use_attention_mask:
           lowercase_      :Dict         =			random_attention_mask([self.batch_size, self.seq_length]						)

        lowercase_      :Optional[int]         =			DistilBertConfig(
            vocab_size=self.vocab_size     ,				dim=self.hidden_size     ,				n_layers=self.num_hidden_layers     ,				n_heads=self.num_attention_heads     ,				hidden_dim=self.intermediate_size     ,				hidden_act=self.hidden_act     ,				dropout=self.hidden_dropout_prob     ,				attention_dropout=self.attention_probs_dropout_prob     ,				max_position_embeddings=self.max_position_embeddings     ,				initializer_range=self.initializer_range     ,				tie_weights_=__a     ,				)

        return config, input_ids, attention_mask







     def 							lowercase__				(			self		: Any						):





        """simple docstring"""




        lowercase_      :Tuple         =			self.prepare_config_and_inputs()
        lowercase_      :Optional[int]         =			config_and_inputs
        lowercase_      :List[str]         =			{'input_ids': input_ids, 'attention_mask': attention_mask}
        return config, inputs_dict







@require_flax
class 				a_       (    SCREAMING_SNAKE_CASE_     ,						unittest.TestCase							):
     __A								=      (
         (
             FlaxDistilBertModel,
             FlaxDistilBertForMaskedLM,
             FlaxDistilBertForMultipleChoice,
             FlaxDistilBertForQuestionAnswering,
             FlaxDistilBertForSequenceClassification,
             FlaxDistilBertForTokenClassification,
             FlaxDistilBertForQuestionAnswering,
         )
         if is_flax_available()
         else ()
     )





     def 							lowercase__				(			self		: Dict						):





        """simple docstring"""




        lowercase_      :Optional[int]         =			FlaxDistilBertModelTester(self						)







     @slow
     def 							lowercase__				(			self		: Tuple						):





        """simple docstring"""




        for model_class_name in self.all_model_classes:
           lowercase_      :Optional[int]         =			model_class_name.from_pretrained("distilbert-base-uncased"						)
           lowercase_      :List[Any]         =			model(np.ones((1, 1)						)						)
           self.assertIsNotNone(__a						)







@require_flax
class 				a_       (    unittest.TestCase							):





     @slow
     def 							lowercase__				(			self		: Any						):





        """simple docstring"""




        lowercase_      :Optional[int]         =			FlaxDistilBertModel.from_pretrained("distilbert-base-uncased"						)
        lowercase_      :Tuple         =			np.array([[0, 345, 232, 328, 740, 140, 1_695, 69, 6_078, 1_588, 2]]						)
        lowercase_      :Tuple         =			np.array([[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]						)
        lowercase_      :str         =			model(__a     ,				attention_mask=__a						)[0]
        lowercase_      :List[str]         =			(1, 11, 768)
        self.assertEqual(output.shape     ,				__a						)
        lowercase_      :Dict         =			np.array([[[-0.16_39, 0.32_99, 0.16_48], [-0.17_46, 0.32_89, 0.17_10], [-0.18_84, 0.33_57, 0.18_10]]]						)

        self.assertTrue(jnp.allclose(output[:, 1:4, 1:4]     ,				__a     ,				atol=1e-4						)						)









'''simple docstring'''


import sys

lowerCAmelCase :					List[Any] 							=(
    '''73167176531330624919225119674426574742355349194934'''
    '''96983520312774506326239578318016984801869478851843'''
    '''85861560789112949495459501737958331952853208805511'''
    '''12540698747158523863050715693290963295227443043557'''
    '''66896648950445244523161731856403098711121722383113'''
    '''62229893423380308135336276614282806444486645238749'''
    '''30358907296290491560440772390713810515859307960866'''
    '''70172427121883998797908792274921901699720888093776'''
    '''65727333001053367881220235421809751254540594752243'''
    '''52584907711670556013604839586446706324415722155397'''
    '''53697817977846174064955149290862569321978468622482'''
    '''83972241375657056057490261407972968652414535100474'''
    '''82166370484403199890008895243450658541227588666881'''
    '''16427171479924442928230863465674813919123162824586'''
    '''17866458359124566529476545682848912883142607690042'''
    '''24219022671055626321111109370544217506941658960408'''
    '''07198403850962455444362981230987879927244284909188'''
    '''84580156166097919133875499200524063689912560717606'''
    '''05886116467109405077541002256983155200055935729725'''
    '''71636269561882670428252483600823257530420752963450'''
)
def 							UpperCAmelCase_  (						__lowerCamelCase : str			):
   lowercase_      :List[str]         =			1
   for digit in s:
      product *= int(__lowerCamelCase			)
   return product
def 							UpperCAmelCase_  (						__lowerCamelCase : str = N			):
   lowercase_      :Any         =			-sys.maxsize - 1
   lowercase_      :int         =			n[:13]
   lowercase_      :Optional[int]         =			13
   while cur_index < len(__lowerCamelCase			) - 13:
      if int(n[cur_index]			) >= int(substr[0]			):
         lowercase_      :str         =			substr[1:] + n[cur_index]
         cur_index += 1
      else:
         lowercase_      :List[str]         =			max(__lowerCamelCase     ,str_eval(__lowerCamelCase			)			)
         lowercase_      :Any         =			n[cur_index : cur_index + 13]
         cur_index += 13
   return largest_product


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


