




from __future__ import annotations

import unittest

from transformers import DistilBertConfig, 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 tensorflow as tf

   from transformers.models.distilbert.modeling_tf_distilbert import (
       TF_DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
       TFDistilBertForMaskedLM,
       TFDistilBertForMultipleChoice,
       TFDistilBertForQuestionAnswering,
       TFDistilBertForSequenceClassification,
       TFDistilBertForTokenClassification,
       TFDistilBertModel,
   )





class 	lowerCamelCase_							:


 '''simple docstring'''







 def __init__(							self  :		str    ,    _lowerCAmelCase  :		Union[str, Any]    ,    ):
       SCREAMING_SNAKE_CASE_     						=      parent
       SCREAMING_SNAKE_CASE_     						=      13
       SCREAMING_SNAKE_CASE_     						=      7
       SCREAMING_SNAKE_CASE_     						=      True
       SCREAMING_SNAKE_CASE_     						=      True
       SCREAMING_SNAKE_CASE_     						=      False
       SCREAMING_SNAKE_CASE_     						=      True
       SCREAMING_SNAKE_CASE_     						=      99
       SCREAMING_SNAKE_CASE_     						=      32
       SCREAMING_SNAKE_CASE_     						=      2
       SCREAMING_SNAKE_CASE_     						=      4
       SCREAMING_SNAKE_CASE_     						=      37
       SCREAMING_SNAKE_CASE_     						=      'gelu'
       SCREAMING_SNAKE_CASE_     						=      0.1
       SCREAMING_SNAKE_CASE_     						=      0.1
       SCREAMING_SNAKE_CASE_     						=      512
       SCREAMING_SNAKE_CASE_     						=      16
       SCREAMING_SNAKE_CASE_     						=      2
       SCREAMING_SNAKE_CASE_     						=      0.02
       SCREAMING_SNAKE_CASE_     						=      3
       SCREAMING_SNAKE_CASE_     						=      4
       SCREAMING_SNAKE_CASE_     						=      None



 def 				lowerCAmelCase_  (							self  :		str						):
       SCREAMING_SNAKE_CASE_     						=      ids_tensor([self.batch_size, self.seq_length]    ,    self.vocab_size						)

       SCREAMING_SNAKE_CASE_     						=      None
       if self.use_input_mask:
             SCREAMING_SNAKE_CASE_     						=      random_attention_mask([self.batch_size, self.seq_length]						)

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

       SCREAMING_SNAKE_CASE_     						=      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    ,    )

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



 def 				lowerCAmelCase_  (							self  :		List[str]    ,    _lowerCAmelCase  :		str    ,    _lowerCAmelCase  :		List[str]    ,    _lowerCAmelCase  :		str    ,    _lowerCAmelCase  :		Optional[Any]    ,    _lowerCAmelCase  :		Optional[int]    ,    _lowerCAmelCase  :		int						):
       SCREAMING_SNAKE_CASE_     						=      TFDistilBertModel(config=__a						)
       SCREAMING_SNAKE_CASE_     						=      {'input_ids': input_ids, 'attention_mask': input_mask}

       SCREAMING_SNAKE_CASE_     						=      model(__a						)

       SCREAMING_SNAKE_CASE_     						=      [input_ids, input_mask]

       SCREAMING_SNAKE_CASE_     						=      model(__a						)

       self.parent.assertEqual(result.last_hidden_state.shape    ,    (self.batch_size, self.seq_length, self.hidden_size)						)



 def 				lowerCAmelCase_  (							self  :		Union[str, Any]    ,    _lowerCAmelCase  :		Any    ,    _lowerCAmelCase  :		Optional[int]    ,    _lowerCAmelCase  :		str    ,    _lowerCAmelCase  :		Optional[int]    ,    _lowerCAmelCase  :		Union[str, Any]    ,    _lowerCAmelCase  :		Optional[int]						):
       SCREAMING_SNAKE_CASE_     						=      TFDistilBertForMaskedLM(config=__a						)
       SCREAMING_SNAKE_CASE_     						=      {'input_ids': input_ids, 'attention_mask': input_mask}
       SCREAMING_SNAKE_CASE_     						=      model(__a						)
       self.parent.assertEqual(result.logits.shape    ,    (self.batch_size, self.seq_length, self.vocab_size)						)



 def 				lowerCAmelCase_  (							self  :		List[str]    ,    _lowerCAmelCase  :		int    ,    _lowerCAmelCase  :		str    ,    _lowerCAmelCase  :		List[str]    ,    _lowerCAmelCase  :		Optional[Any]    ,    _lowerCAmelCase  :		Dict    ,    _lowerCAmelCase  :		List[Any]						):
       SCREAMING_SNAKE_CASE_     						=      TFDistilBertForQuestionAnswering(config=__a						)
       SCREAMING_SNAKE_CASE_     						=      {
           'input_ids': input_ids,
           'attention_mask': input_mask,
       }
       SCREAMING_SNAKE_CASE_     						=      model(__a						)
       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)						)



 def 				lowerCAmelCase_  (							self  :		List[Any]    ,    _lowerCAmelCase  :		Dict    ,    _lowerCAmelCase  :		List[Any]    ,    _lowerCAmelCase  :		Optional[Any]    ,    _lowerCAmelCase  :		Optional[int]    ,    _lowerCAmelCase  :		int    ,    _lowerCAmelCase  :		Any						):
       SCREAMING_SNAKE_CASE_     						=      self.num_labels
       SCREAMING_SNAKE_CASE_     						=      TFDistilBertForSequenceClassification(__a						)
       SCREAMING_SNAKE_CASE_     						=      {'input_ids': input_ids, 'attention_mask': input_mask}
       SCREAMING_SNAKE_CASE_     						=      model(__a						)
       self.parent.assertEqual(result.logits.shape    ,    (self.batch_size, self.num_labels)						)



 def 				lowerCAmelCase_  (							self  :		List[str]    ,    _lowerCAmelCase  :		Union[str, Any]    ,    _lowerCAmelCase  :		List[Any]    ,    _lowerCAmelCase  :		int    ,    _lowerCAmelCase  :		str    ,    _lowerCAmelCase  :		Optional[Any]    ,    _lowerCAmelCase  :		List[Any]						):
       SCREAMING_SNAKE_CASE_     						=      self.num_choices
       SCREAMING_SNAKE_CASE_     						=      TFDistilBertForMultipleChoice(__a						)
       SCREAMING_SNAKE_CASE_     						=      tf.tile(tf.expand_dims(__a    ,    1						)    ,    (1, self.num_choices, 1)						)
       SCREAMING_SNAKE_CASE_     						=      tf.tile(tf.expand_dims(__a    ,    1						)    ,    (1, self.num_choices, 1)						)
       SCREAMING_SNAKE_CASE_     						=      {
           'input_ids': multiple_choice_inputs_ids,
           'attention_mask': multiple_choice_input_mask,
       }
       SCREAMING_SNAKE_CASE_     						=      model(__a						)
       self.parent.assertEqual(result.logits.shape    ,    (self.batch_size, self.num_choices)						)



 def 				lowerCAmelCase_  (							self  :		List[Any]    ,    _lowerCAmelCase  :		Optional[int]    ,    _lowerCAmelCase  :		str    ,    _lowerCAmelCase  :		Union[str, Any]    ,    _lowerCAmelCase  :		Optional[int]    ,    _lowerCAmelCase  :		Dict    ,    _lowerCAmelCase  :		Tuple						):
       SCREAMING_SNAKE_CASE_     						=      self.num_labels
       SCREAMING_SNAKE_CASE_     						=      TFDistilBertForTokenClassification(__a						)
       SCREAMING_SNAKE_CASE_     						=      {'input_ids': input_ids, 'attention_mask': input_mask}
       SCREAMING_SNAKE_CASE_     						=      model(__a						)
       self.parent.assertEqual(result.logits.shape    ,    (self.batch_size, self.seq_length, self.num_labels)						)




 def 				lowerCAmelCase_  (							self  :		Optional[int]						):
       SCREAMING_SNAKE_CASE_     						=      self.prepare_config_and_inputs()
       ((SCREAMING_SNAKE_CASE_)						,			(SCREAMING_SNAKE_CASE_)						,			(SCREAMING_SNAKE_CASE_)						,			(SCREAMING_SNAKE_CASE_)						,			(SCREAMING_SNAKE_CASE_)						,			(SCREAMING_SNAKE_CASE_))     						=      config_and_inputs
       SCREAMING_SNAKE_CASE_     						=      {'input_ids': input_ids, 'attention_mask': input_mask}
       return config, inputs_dict





@require_tf
class 	lowerCamelCase_							(				UpperCamelCase__	,       UpperCamelCase__	,       unittest.TestCase ):


 '''simple docstring'''







 lowercase_       =   (
     (
         TFDistilBertModel,
         TFDistilBertForMaskedLM,
         TFDistilBertForQuestionAnswering,
         TFDistilBertForSequenceClassification,
         TFDistilBertForTokenClassification,
         TFDistilBertForMultipleChoice,
     )
     if is_tf_available()
     else None
 )
 lowercase_       =   (
     {
         """feature-extraction""": TFDistilBertModel,
         """fill-mask""": TFDistilBertForMaskedLM,
         """question-answering""": TFDistilBertForQuestionAnswering,
         """text-classification""": TFDistilBertForSequenceClassification,
         """token-classification""": TFDistilBertForTokenClassification,
         """zero-shot""": TFDistilBertForSequenceClassification,
     }
     if is_tf_available()
     else {}
 )
 lowercase_       =   False
 lowercase_       =   False



 def 				lowerCAmelCase_  (							self  :		Optional[int]						):
       SCREAMING_SNAKE_CASE_     						=      TFDistilBertModelTester(self						)
       SCREAMING_SNAKE_CASE_     						=      ConfigTester(self    ,    config_class=__a    ,    dim=37						)



 def 				lowerCAmelCase_  (							self  :		Union[str, Any]						):
       self.config_tester.run_common_tests()



 def 				lowerCAmelCase_  (							self  :		Dict						):
       SCREAMING_SNAKE_CASE_     						=      self.model_tester.prepare_config_and_inputs()
       self.model_tester.create_and_check_distilbert_model(*__a						)



 def 				lowerCAmelCase_  (							self  :		List[Any]						):
       SCREAMING_SNAKE_CASE_     						=      self.model_tester.prepare_config_and_inputs()
       self.model_tester.create_and_check_distilbert_for_masked_lm(*__a						)



 def 				lowerCAmelCase_  (							self  :		Union[str, Any]						):
       SCREAMING_SNAKE_CASE_     						=      self.model_tester.prepare_config_and_inputs()
       self.model_tester.create_and_check_distilbert_for_question_answering(*__a						)



 def 				lowerCAmelCase_  (							self  :		Tuple						):
       SCREAMING_SNAKE_CASE_     						=      self.model_tester.prepare_config_and_inputs()
       self.model_tester.create_and_check_distilbert_for_sequence_classification(*__a						)



 def 				lowerCAmelCase_  (							self  :		Optional[int]						):
       SCREAMING_SNAKE_CASE_     						=      self.model_tester.prepare_config_and_inputs()
       self.model_tester.create_and_check_distilbert_for_multiple_choice(*__a						)



 def 				lowerCAmelCase_  (							self  :		List[Any]						):
       SCREAMING_SNAKE_CASE_     						=      self.model_tester.prepare_config_and_inputs()
       self.model_tester.create_and_check_distilbert_for_token_classification(*__a						)




 @slow
 def 				lowerCAmelCase_  (							self  :		Any						):
       for model_name in list(TF_DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]						):
             SCREAMING_SNAKE_CASE_     						=      TFDistilBertModel.from_pretrained(__a						)
             self.assertIsNotNone(__a						)





@require_tf
class 	lowerCamelCase_							(				unittest.TestCase ):


 '''simple docstring'''







 @slow
 def 				lowerCAmelCase_  (							self  :		Union[str, Any]						):
       SCREAMING_SNAKE_CASE_     						=      TFDistilBertModel.from_pretrained('distilbert-base-uncased'						)
       SCREAMING_SNAKE_CASE_     						=      tf.constant([[0, 1, 2, 3, 4, 5]]						)
       SCREAMING_SNAKE_CASE_     						=      model(__a						)[0]

       SCREAMING_SNAKE_CASE_     						=      [1, 6, 768]
       self.assertEqual(output.shape    ,    __a						)

       SCREAMING_SNAKE_CASE_     						=      tf.constant(
           [
               [
                   [0.1926_1885, -0.1373_2955, 0.411_9799],
                   [0.2215_0156, -0.0742_2661, 0.3903_7204],
                   [0.2275_6018, -0.089_6414, 0.370_1467],
               ]
           ]						)
       tf.debugging.assert_near(output[:, :3, :3]    ,    __a    ,    atol=1E-4						)





def  UpperCAmelCase_							(				) ->			int:
      return 1

def  UpperCAmelCase_							(				__UpperCAmelCase						:     int							) ->			int:
      return 0 if x < 0 else two_pence(x - 2							) + one_pence()

def  UpperCAmelCase_							(				__UpperCAmelCase						:     int							) ->			int:
      return 0 if x < 0 else five_pence(x - 5							) + two_pence(__UpperCAmelCase							)

def  UpperCAmelCase_							(				__UpperCAmelCase						:     int							) ->			int:
      return 0 if x < 0 else ten_pence(x - 10							) + five_pence(__UpperCAmelCase							)

def  UpperCAmelCase_							(				__UpperCAmelCase						:     int							) ->			int:
      return 0 if x < 0 else twenty_pence(x - 20							) + ten_pence(__UpperCAmelCase							)

def  UpperCAmelCase_							(				__UpperCAmelCase						:     int							) ->			int:
      return 0 if x < 0 else fifty_pence(x - 50							) + twenty_pence(__UpperCAmelCase							)

def  UpperCAmelCase_							(				__UpperCAmelCase						:     int							) ->			int:
      return 0 if x < 0 else one_pound(x - 1_00							) + fifty_pence(__UpperCAmelCase							)

def  UpperCAmelCase_							(				__UpperCAmelCase						:     int							) ->			int:
      return 0 if x < 0 else two_pound(x - 2_00							) + one_pound(__UpperCAmelCase							)

def  UpperCAmelCase_							(				__UpperCAmelCase						:     int = 2_00							) ->			int:
      return two_pound(__UpperCAmelCase							)


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