






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     ):






  """simple docstring"""





  def __init__(  self		,		_UpperCAmelCase		,		_UpperCAmelCase=13		,		_UpperCAmelCase=7		,		_UpperCAmelCase=True		,		_UpperCAmelCase=True		,		_UpperCAmelCase=True		,		_UpperCAmelCase=True		,		_UpperCAmelCase=99		,		_UpperCAmelCase=32		,		_UpperCAmelCase=5		,		_UpperCAmelCase=4		,		_UpperCAmelCase=37		,		_UpperCAmelCase="gelu"		,		_UpperCAmelCase=0.1		,		_UpperCAmelCase=0.1		,		_UpperCAmelCase=512		,		_UpperCAmelCase=16		,		_UpperCAmelCase=2		,		_UpperCAmelCase=0.0_2		,		_UpperCAmelCase=4		,		)      ->			int:
     UpperCamelCase_						=  parent
     UpperCamelCase_						=  batch_size
     UpperCamelCase_						=  seq_length
     UpperCamelCase_						=  is_training
     UpperCamelCase_						=  use_attention_mask
     UpperCamelCase_						=  use_token_type_ids
     UpperCamelCase_						=  use_labels
     UpperCamelCase_						=  vocab_size
     UpperCamelCase_						=  hidden_size
     UpperCamelCase_						=  num_hidden_layers
     UpperCamelCase_						=  num_attention_heads
     UpperCamelCase_						=  intermediate_size
     UpperCamelCase_						=  hidden_act
     UpperCamelCase_						=  hidden_dropout_prob
     UpperCamelCase_						=  attention_probs_dropout_prob
     UpperCamelCase_						=  max_position_embeddings
     UpperCamelCase_						=  type_vocab_size
     UpperCamelCase_						=  type_sequence_label_size
     UpperCamelCase_						=  initializer_range
     UpperCamelCase_						=  num_choices




  def  _UpperCAmelCase  (  self			)      ->			str:
     UpperCamelCase_						=  ids_tensor([self.batch_size, self.seq_length]		,		self.vocab_size			)

     UpperCamelCase_						=  None
     if self.use_attention_mask:
        UpperCamelCase_						=  random_attention_mask([self.batch_size, self.seq_length]			)

     UpperCamelCase_						=  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_=_UpperCAmelCase		,		)

     return config, input_ids, attention_mask




  def  _UpperCAmelCase  (  self			)      ->			Optional[int]:
     UpperCamelCase_						=  self.prepare_config_and_inputs()
     UpperCamelCase_		,   UpperCamelCase_		,   UpperCamelCase_						=  config_and_inputs
     UpperCamelCase_						=  {'input_ids': input_ids, 'attention_mask': attention_mask}
     return config, inputs_dict




@require_flax
class     _a							(	UpperCAmelCase__    ,							unittest.TestCase     ):






  """simple docstring"""





  A_						       = (
      (
          FlaxDistilBertModel,
          FlaxDistilBertForMaskedLM,
          FlaxDistilBertForMultipleChoice,
          FlaxDistilBertForQuestionAnswering,
          FlaxDistilBertForSequenceClassification,
          FlaxDistilBertForTokenClassification,
          FlaxDistilBertForQuestionAnswering,
      )
      if is_flax_available()
      else ()
  )




  def  _UpperCAmelCase  (  self			)      ->			List[Any]:
     UpperCamelCase_						=  FlaxDistilBertModelTester(self			)




  @slow
  def  _UpperCAmelCase  (  self			)      ->			List[str]:
     for model_class_name in self.all_model_classes:
        UpperCamelCase_						=  model_class_name.from_pretrained('distilbert-base-uncased'			)
        UpperCamelCase_						=  model(np.ones((1, 1)			)			)
        self.assertIsNotNone(_UpperCAmelCase			)




@require_flax
class     _a							(	unittest.TestCase     ):






  """simple docstring"""





  @slow
  def  _UpperCAmelCase  (  self			)      ->			Optional[Any]:
     UpperCamelCase_						=  FlaxDistilBertModel.from_pretrained('distilbert-base-uncased'			)
     UpperCamelCase_						=  np.array([[0, 345, 232, 328, 740, 140, 1695, 69, 6078, 1588, 2]]			)
     UpperCamelCase_						=  np.array([[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]			)
     UpperCamelCase_						=  model(_UpperCAmelCase		,		attention_mask=_UpperCAmelCase			)[0]
     UpperCamelCase_						=  (1, 11, 768)
     self.assertEqual(output.shape		,		_UpperCAmelCase			)
     UpperCamelCase_						=  np.array([[[-0.1_6_3_9, 0.3_2_9_9, 0.1_6_4_8], [-0.1_7_4_6, 0.3_2_8_9, 0.1_7_1_0], [-0.1_8_8_4, 0.3_3_5_7, 0.1_8_1_0]]]			)

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













def      _snake_case     (__lowercase):
   UpperCamelCase_						=  1
   for i in range(1     ,   num + 1):
      fact *= i
   return fact






def      _snake_case     (__lowercase):
   UpperCamelCase_						=  0
   while number > 0:
      UpperCamelCase_						=  number % 10
      sum_of_digits += last_digit
      UpperCamelCase_						=  number // 10  # Removing the last_digit from the given number
   return sum_of_digits






def      _snake_case     (__lowercase = 100):
   UpperCamelCase_						=  factorial(__lowercase)
   UpperCamelCase_						=  split_and_add(__lowercase)
   return result


if __name__ == "__main__":
 print(solution(int(input("""Enter the Number: """).strip())))





