





'''simple docstring'''


import unittest

from datasets import load_dataset

from transformers.pipelines import pipeline
from transformers.testing_utils import is_pipeline_test, nested_simplify, require_torch, slow

@is_pipeline_test
@require_torch
class       lowerCAmelCase_						(						unittest.TestCase						):




 @require_torch
 def 							_snake_case      (		self						)			->							Dict:
     _lowerCAmelCase			=					pipeline(
         task="zero-shot-audio-classification"	,   model="hf-internal-testing/tiny-clap-htsat-unfused"						)
     _lowerCAmelCase			=					load_dataset("ashraq/esc50"						)
     _lowerCAmelCase			=					dataset["""train"""]["""audio"""][-1]["""array"""]
     _lowerCAmelCase			=					audio_classifier(lowercase_	,   candidate_labels=["Sound of a dog", "Sound of vaccum cleaner"]						)
     self.assertEqual(
         nested_simplify(lowercase_						)	,   [{"score": 0.501, "label": "Sound of a dog"}, {"score": 0.499, "label": "Sound of vaccum cleaner"}]	,   )




 @unittest.skip("No models are available in TF"						)
 def 							_snake_case      (		self						)			->							str:
     pass




 @slow
 @require_torch
 def 							_snake_case      (		self						)			->							Any:
     _lowerCAmelCase			=					pipeline(
         task="zero-shot-audio-classification"	,   model="laion/clap-htsat-unfused"	,   )
     # This is an audio of a dog
     _lowerCAmelCase			=					load_dataset("ashraq/esc50"						)
     _lowerCAmelCase			=					dataset["""train"""]["""audio"""][-1]["""array"""]
     _lowerCAmelCase			=					audio_classifier(lowercase_	,   candidate_labels=["Sound of a dog", "Sound of vaccum cleaner"]						)

     self.assertEqual(
         nested_simplify(lowercase_						)	,   [
             {"score": 0.999, "label": "Sound of a dog"},
             {"score": 0.001, "label": "Sound of vaccum cleaner"},
         ]	,   )

     _lowerCAmelCase			=					audio_classifier([audio] * 5	,   candidate_labels=["Sound of a dog", "Sound of vaccum cleaner"]						)
     self.assertEqual(
         nested_simplify(lowercase_						)	,   [
             [
                 {"score": 0.999, "label": "Sound of a dog"},
                 {"score": 0.001, "label": "Sound of vaccum cleaner"},
             ],
         ]
         * 5	,   )
     _lowerCAmelCase			=					audio_classifier(
         [audio] * 5	,   candidate_labels=["Sound of a dog", "Sound of vaccum cleaner"]	,   batch_size=5						)
     self.assertEqual(
         nested_simplify(lowercase_						)	,   [
             [
                 {"score": 0.999, "label": "Sound of a dog"},
                 {"score": 0.001, "label": "Sound of vaccum cleaner"},
             ],
         ]
         * 5	,   )





 @unittest.skip("No models are available in TF"						)
 def 							_snake_case      (		self						)			->							int:
     pass



'''simple docstring'''




import math




def 							lowerCamelCase	(      UpperCAmelCase__       :					int )			->      int:

							if not isinstance(UpperCAmelCase__      ,      UpperCAmelCase__ ):
														lowercase_					:			List[Any]										=       F'''Input value of [number={number}] must be an integer'''
														raise TypeError(UpperCAmelCase__ )

							if number < 1:
														lowercase_					:			Tuple										=       F'''Input value of [number={number}] must be > 0'''
														raise ValueError(UpperCAmelCase__ )
							elif number == 1:
														return 3
							elif number == 2:
														return 5
							else:
														lowercase_					:			Union[str, Any]										=       int(math.log(number // 3      ,      2 ) ) + 2

														lowercase_					:			Any										=       [3, 5]
														lowercase_					:			List[Any]										=       2
														lowercase_					:			Optional[Any]										=       3
														for block in range(1      ,      UpperCAmelCase__ ):
																					for _ in range(UpperCAmelCase__ ):
																												proth_list.append(2 ** (block + 1) + proth_list[proth_index - 1] )
																												proth_index += 1
																					increment *= 2

							return proth_list[number - 1]


if __name__ == "__main__":
						import doctest

						doctest.testmod()

						for number in range(11):
												_lowercase						: Optional[Any]						=						0
												try:
																		_lowercase						: str						=						proth(number)
												except ValueError:
																		print(f"""ValueError: there is no {number}th Proth number""")
																		continue

												print(f"""The {number}th Proth number: {value}""")





