





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 			lowerCamelCase  (self    )     ->   List[str]:


							'''simple docstring'''



							snake_case_						:    str				=  pipeline(
							    task='''zero-shot-audio-classification'''					,							model='''hf-internal-testing/tiny-clap-htsat-unfused'''    )
							snake_case_						:    Tuple				=  load_dataset('''ashraq/esc50'''    )
							snake_case_						:    List[str]				=  dataset['''train''']['''audio'''][-1]['''array''']
							snake_case_						:    Optional[int]				=  audio_classifier(__magic_name__					,							candidate_labels=['''Sound of a dog''', '''Sound of vaccum cleaner''']    )
							self.assertEqual(
							    nested_simplify(__magic_name__    )					,							[{'''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 			lowerCamelCase  (self    )     ->   List[Any]:


							'''simple docstring'''



							pass






			@slow
			@require_torch
			def 			lowerCamelCase  (self    )     ->   int:


							'''simple docstring'''



							snake_case_						:    List[str]				=  pipeline(
							    task='''zero-shot-audio-classification'''					,							model='''laion/clap-htsat-unfused'''					,							)
							# This is an audio of a dog
							snake_case_						:    Dict				=  load_dataset('''ashraq/esc50'''    )
							snake_case_						:    List[Any]				=  dataset['''train''']['''audio'''][-1]['''array''']
							snake_case_						:    int				=  audio_classifier(__magic_name__					,							candidate_labels=['''Sound of a dog''', '''Sound of vaccum cleaner''']    )

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

							snake_case_						:    List[str]				=  audio_classifier([audio] * 5					,							candidate_labels=['''Sound of a dog''', '''Sound of vaccum cleaner''']    )
							self.assertEqual(
							    nested_simplify(__magic_name__    )					,							[
							        [
							            {'''score''': 0.999, '''label''': '''Sound of a dog'''},
							            {'''score''': 0.001, '''label''': '''Sound of vaccum cleaner'''},
							        ],
							    ]
							    * 5					,							)
							snake_case_						:    List[Any]				=  audio_classifier(
							    [audio] * 5					,							candidate_labels=['''Sound of a dog''', '''Sound of vaccum cleaner''']					,							batch_size=5    )
							self.assertEqual(
							    nested_simplify(__magic_name__    )					,							[
							        [
							            {'''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 			lowerCamelCase  (self    )     ->   Optional[int]:


							'''simple docstring'''



							pass







def      lowerCamelCase_						(				_UpperCamelCase ,				_UpperCamelCase )		->						str:






				"""simple docstring"""


				return "\n".join(
				    f'''{number} * {i} = {number * i}''' for i in range(1 ,				number_of_terms + 1 ) )


if __name__ == "__main__":
	print(multiplication_table(number=5, number_of_terms=1_0))
