



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



	@require_torch
	def 		UpperCamelCase				(    self				:     Dict)->				str:
						__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(a_					,						candidate_labels=["""Sound of a dog""", """Sound of vaccum cleaner"""])
						self.assertEqual(
						    nested_simplify(a_)					,						[{"""score""": 0.5_0_1, """label""": """Sound of a dog"""}, {"""score""": 0.4_9_9, """label""": """Sound of vaccum cleaner"""}]					,						)



	@unittest.skip("""No models are available in TF""")
	def 		UpperCamelCase				(    self				:     Union[str, Any])->				Any:
						pass



	@slow
	@require_torch
	def 		UpperCamelCase				(    self				:     List[Any])->				List[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(a_					,						candidate_labels=["""Sound of a dog""", """Sound of vaccum cleaner"""])

						self.assertEqual(
						    nested_simplify(a_)					,						[
						        {"""score""": 0.9_9_9, """label""": """Sound of a dog"""},
						        {"""score""": 0.0_0_1, """label""": """Sound of vaccum cleaner"""},
						    ]					,						)

						__lowerCAmelCase						 =audio_classifier([audio] * 5					,						candidate_labels=["""Sound of a dog""", """Sound of vaccum cleaner"""])
						self.assertEqual(
						    nested_simplify(a_)					,						[
						        [
						            {"""score""": 0.9_9_9, """label""": """Sound of a dog"""},
						            {"""score""": 0.0_0_1, """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(a_)					,						[
						        [
						            {"""score""": 0.9_9_9, """label""": """Sound of a dog"""},
						            {"""score""": 0.0_0_1, """label""": """Sound of vaccum cleaner"""},
						        ],
						    ]
						    * 5					,						)



	@unittest.skip("""No models are available in TF""")
	def 		UpperCamelCase				(    self				:     Any)->				Union[str, Any]:
						pass











"""simple docstring"""






from maths.is_square_free import is_square_free
from maths.prime_factors import prime_factors






def      lowercase__ (					lowerCAmelCase__   :			int			)    ->			int:



			'''simple docstring'''
			a__  :	Tuple		 =			prime_factors(lowerCAmelCase__			)
			if is_square_free(lowerCAmelCase__			):
						return -1 if len(lowerCAmelCase__			) % 2 else 1
			return 0


if __name__ == "__main__":
		import doctest

		doctest.testmod()