


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



		"""simple docstring"""

		@require_torch
		def 					__A   ( self	)  -> List[str]:







					'''simple docstring'''







					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.501, """label""": """Sound of a dog"""}, {"""score""": 0.499, """label""": """Sound of vaccum cleaner"""}]		,      )







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







					'''simple docstring'''







					pass







		@slow
		@require_torch
		def 					__A   ( self	)  -> List[Any]:







					'''simple docstring'''







					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.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(A	)		,      [
					        [
					            {"""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(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 					__A   ( self	)  -> Union[str, Any]:







					'''simple docstring'''







					pass





UpperCAmelCase   :    Any     =		[0, 2, 4, 6, 8]
UpperCAmelCase   :    Optional[Any]     =		[1, 3, 5, 7, 9]






def 	__lowerCamelCase						(							lowerCamelCase__		:						int  ,							lowerCamelCase__		:						int  ,							lowerCamelCase__		:						list[int]  ,							lowerCamelCase__		:						int      ):





			'''simple docstring'''




			if remaining_length == 0:
						if digits[0] == 0 or digits[-1] == 0:
									return 0

						for i in range(length // 2 - 1  ,							-1  ,							-1      ):
									remainder += digits[i] + digits[length - i - 1]

									if remainder % 2 == 0:
												return 0

									remainder //= 10

						return 1

			if remaining_length == 1:
						if remainder % 2 == 0:
									return 0

						lowerCamelCase    		=  0
						for digit in range(10      ):
									lowerCamelCase    		=  digit
									result += reversible_numbers(
									    0  ,							(remainder + 2 * digit) // 10  ,							lowerCamelCase__  ,							lowerCamelCase__      )
						return result

			lowerCamelCase    		=  0
			for digita in range(10      ):
						lowerCamelCase    		=  digita

						if (remainder + digita) % 2 == 0:
									lowerCamelCase    		=  ODD_DIGITS
						else:
									lowerCamelCase    		=  EVEN_DIGITS

						for digita in other_parity_digits:
									lowerCamelCase    		=  digita
									result += reversible_numbers(
									    remaining_length - 2  ,							(remainder + digita + digita) // 10  ,							lowerCamelCase__  ,							lowerCamelCase__  ,							)
			return result






def 	__lowerCamelCase						(							lowerCamelCase__		:						int = 9      ):





			'''simple docstring'''




			lowerCamelCase    		=  0
			for length in range(1  ,							max_power + 1      ):
						result += reversible_numbers(lowerCamelCase__  ,							0  ,							[0] * length  ,							lowerCamelCase__      )
			return result


if __name__ == "__main__":
		print(f"""{solution() = }""")

