




'''simple docstring'''
from graphs.minimum_spanning_tree_kruskal import kruskal





def 			lowerCamelCase(							)		->		str:
			A_									= 9
			A_									= [
			    [0, 1, 4],
			    [0, 7, 8],
			    [1, 2, 8],
			    [7, 8, 7],
			    [7, 6, 1],
			    [2, 8, 2],
			    [8, 6, 6],
			    [2, 3, 7],
			    [2, 5, 4],
			    [6, 5, 2],
			    [3, 5, 14],
			    [3, 4, 9],
			    [5, 4, 10],
			    [1, 7, 11],
			]

			A_									= kruskal(SCREAMING_SNAKE_CASE_       ,SCREAMING_SNAKE_CASE_     )

			A_									= [
			    [7, 6, 1],
			    [2, 8, 2],
			    [6, 5, 2],
			    [0, 1, 4],
			    [2, 5, 4],
			    [2, 3, 7],
			    [0, 7, 8],
			    [3, 4, 9],
			]

			assert sorted(SCREAMING_SNAKE_CASE_     ) == sorted(SCREAMING_SNAKE_CASE_     )










'''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   __UpperCAmelCase				(     unittest.TestCase				):



					'''simple docstring'''





					@require_torch
					def     __snake_case						(	self     :						str)    ->							Optional[int]:
								A_									= pipeline(
								    task='zero-shot-audio-classification'      ,       model='hf-internal-testing/tiny-clap-htsat-unfused')
								A_									= load_dataset('ashraq/esc50')
								A_									= dataset['train']['audio'][-1]['array']
								A_									= audio_classifier(_lowercase      ,       candidate_labels=['Sound of a dog', 'Sound of vaccum cleaner'])
								self.assertEqual(
								    nested_simplify(_lowercase)      ,       [{'score': 0.5_01, 'label': 'Sound of a dog'}, {'score': 0.4_99, 'label': 'Sound of vaccum cleaner'}]      ,       )



					@unittest.skip('No models are available in TF')
					def     __snake_case						(	self     :						Tuple)    ->							str:
								pass



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

								self.assertEqual(
								    nested_simplify(_lowercase)      ,       [
								        {'score': 0.9_99, 'label': 'Sound of a dog'},
								        {'score': 0.0_01, 'label': 'Sound of vaccum cleaner'},
								    ]      ,       )

								A_									= audio_classifier([audio] * 5      ,       candidate_labels=['Sound of a dog', 'Sound of vaccum cleaner'])
								self.assertEqual(
								    nested_simplify(_lowercase)      ,       [
								        [
								            {'score': 0.9_99, 'label': 'Sound of a dog'},
								            {'score': 0.0_01, 'label': 'Sound of vaccum cleaner'},
								        ],
								    ]
								    * 5      ,       )
								A_									= audio_classifier(
								    [audio] * 5      ,       candidate_labels=['Sound of a dog', 'Sound of vaccum cleaner']      ,       batch_size=5)
								self.assertEqual(
								    nested_simplify(_lowercase)      ,       [
								        [
								            {'score': 0.9_99, 'label': 'Sound of a dog'},
								            {'score': 0.0_01, 'label': 'Sound of vaccum cleaner'},
								        ],
								    ]
								    * 5      ,       )



					@unittest.skip('No models are available in TF')
					def     __snake_case						(	self     :						List[str])    ->							str:
								pass




