



import unittest

import numpy as np

from transformers import MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING, TF_MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING
from transformers.pipelines import AudioClassificationPipeline, pipeline
from transformers.testing_utils import (
    is_pipeline_test,
    nested_simplify,
    require_tf,
    require_torch,
    require_torchaudio,
    slow,
)

from .test_pipelines_common import ANY


@is_pipeline_test
class 	__snake_case   ( unittest.TestCase ):
		SCREAMING_SNAKE_CASE__								=	MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING
		SCREAMING_SNAKE_CASE__								=	TF_MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING
		def 						SCREAMING_SNAKE_CASE_					(							self    ,a_    ,a_    ,a_						):







						"""simple docstring"""
						lowerCAmelCase__		  =  AudioClassificationPipeline(model=a_    ,feature_extractor=a_						)

						# test with a raw waveform
						lowerCAmelCase__		  =  np.zeros((3_4000,)						)
						lowerCAmelCase__		  =  np.zeros((1_4000,)						)
						return audio_classifier, [audioa, audio]
		def 						SCREAMING_SNAKE_CASE_					(							self    ,a_    ,a_						):







						"""simple docstring"""
						lowerCAmelCase__  ,   lowerCAmelCase__		  =  examples
						lowerCAmelCase__		  =  audio_classifier(a_						)
						# by default a model is initialized with num_labels=2
						self.assertEqual(
						    a_    ,[
						        {'score': ANY(a_						), 'label': ANY(a_						)},
						        {'score': ANY(a_						), 'label': ANY(a_						)},
						    ]    ,)
						lowerCAmelCase__		  =  audio_classifier(a_    ,top_k=1						)
						self.assertEqual(
						    a_    ,[
						        {'score': ANY(a_						), 'label': ANY(a_						)},
						    ]    ,)

						self.run_torchaudio(a_						)
		@require_torchaudio
		def 						SCREAMING_SNAKE_CASE_					(							self    ,a_						):







						"""simple docstring"""
						import datasets

						# test with a local file
						lowerCAmelCase__		  =  datasets.load_dataset('hf-internal-testing/librispeech_asr_dummy'    ,'clean'    ,split='validation'						)
						lowerCAmelCase__		  =  dataset[0]['audio']['array']
						lowerCAmelCase__		  =  audio_classifier(a_						)
						self.assertEqual(
						    a_    ,[
						        {'score': ANY(a_						), 'label': ANY(a_						)},
						        {'score': ANY(a_						), 'label': ANY(a_						)},
						    ]    ,)
		@require_torch
		def 						SCREAMING_SNAKE_CASE_					(							self						):







						"""simple docstring"""
						lowerCAmelCase__		  =  'anton-l/wav2vec2-random-tiny-classifier'

						lowerCAmelCase__		  =  pipeline('audio-classification'    ,model=a_						)

						lowerCAmelCase__		  =  np.ones((8000,)						)
						lowerCAmelCase__		  =  audio_classifier(a_    ,top_k=4						)

						lowerCAmelCase__		  =  [
						    {'score': 0.0842, 'label': 'no'},
						    {'score': 0.0838, 'label': 'up'},
						    {'score': 0.0837, 'label': 'go'},
						    {'score': 0.0834, 'label': 'right'},
						]
						lowerCAmelCase__		  =  [
						    {'score': 0.0845, 'label': 'stop'},
						    {'score': 0.0844, 'label': 'on'},
						    {'score': 0.0841, 'label': 'right'},
						    {'score': 0.0834, 'label': 'left'},
						]
						self.assertIn(nested_simplify(a_    ,decimals=4						)    ,[EXPECTED_OUTPUT, EXPECTED_OUTPUT_PT_2]						)

						lowerCAmelCase__		  =  {'array': np.ones((8000,)						), 'sampling_rate': audio_classifier.feature_extractor.sampling_rate}
						lowerCAmelCase__		  =  audio_classifier(a_    ,top_k=4						)
						self.assertIn(nested_simplify(a_    ,decimals=4						)    ,[EXPECTED_OUTPUT, EXPECTED_OUTPUT_PT_2]						)
		@require_torch
		@slow
		def 						SCREAMING_SNAKE_CASE_					(							self						):







						"""simple docstring"""
						import datasets

						lowerCAmelCase__		  =  'superb/wav2vec2-base-superb-ks'

						lowerCAmelCase__		  =  pipeline('audio-classification'    ,model=a_						)
						lowerCAmelCase__		  =  datasets.load_dataset('anton-l/superb_dummy'    ,'ks'    ,split='test'						)

						lowerCAmelCase__		  =  np.array(dataset[3]['speech']    ,dtype=np.floataa						)
						lowerCAmelCase__		  =  audio_classifier(a_    ,top_k=4						)
						self.assertEqual(
						    nested_simplify(a_    ,decimals=3						)    ,[
						        {'score': 0.981, 'label': 'go'},
						        {'score': 0.007, 'label': 'up'},
						        {'score': 0.006, 'label': '_unknown_'},
						        {'score': 0.001, 'label': 'down'},
						    ]    ,)



		@require_tf
		@unittest.skip('Audio classification is not implemented for TF'						)
		def 						SCREAMING_SNAKE_CASE_					(							self						):







						"""simple docstring"""
						pass





def     UpperCAmelCase_		(					)	->     int:



				"""simple docstring"""





				return 1







def     UpperCAmelCase_		(					snake_case__					)	->     int:



				"""simple docstring"""





				return 0 if x < 0 else two_pence(x - 2					) + one_pence()







def     UpperCAmelCase_		(					snake_case__					)	->     int:



				"""simple docstring"""





				return 0 if x < 0 else five_pence(x - 5					) + two_pence(snake_case__					)







def     UpperCAmelCase_		(					snake_case__					)	->     int:



				"""simple docstring"""





				return 0 if x < 0 else ten_pence(x - 10					) + five_pence(snake_case__					)







def     UpperCAmelCase_		(					snake_case__					)	->     int:



				"""simple docstring"""





				return 0 if x < 0 else twenty_pence(x - 20					) + ten_pence(snake_case__					)







def     UpperCAmelCase_		(					snake_case__					)	->     int:



				"""simple docstring"""





				return 0 if x < 0 else fifty_pence(x - 50					) + twenty_pence(snake_case__					)







def     UpperCAmelCase_		(					snake_case__					)	->     int:



				"""simple docstring"""





				return 0 if x < 0 else one_pound(x - 100					) + fifty_pence(snake_case__					)







def     UpperCAmelCase_		(					snake_case__					)	->     int:



				"""simple docstring"""





				return 0 if x < 0 else two_pound(x - 200					) + one_pound(snake_case__					)







def     UpperCAmelCase_		(					snake_case__ = 200					)	->     int:



				"""simple docstring"""





				return two_pound(snake_case__					)


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