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







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

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

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



"""simple docstring"""




def 						A							(  snake_case__		,					snake_case__     ):




			'''simple docstring'''


			SCREAMING_SNAKE_CASE__										=   len(snake_case__     )
			SCREAMING_SNAKE_CASE__										=   len(snake_case__     )
			SCREAMING_SNAKE_CASE__										=   (
			    first_str_length if first_str_length > second_str_length else second_str_length
			)
			SCREAMING_SNAKE_CASE__										=   []
			for char_count in range(snake_case__     ):
						if char_count < first_str_length:
									output_list.append(first_str[char_count]     )
						if char_count < second_str_length:
									output_list.append(second_str[char_count]     )
			return "".join(snake_case__     )


if __name__ == "__main__":
						print(alternative_string_arrange("AB", "XYZ"), end=" ")


