

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





		@require_torch
		def 						A  (		self				:     str			)     ->   Dict:





							'''simple docstring'''






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





							'''simple docstring'''






							pass





		@slow
		@require_torch
		def 						A  (		self				:     Any			)     ->   Union[str, Any]:





							'''simple docstring'''






							_SCREAMING_SNAKE_CASE							   =pipeline(
							    task='zero-shot-audio-classification'							, model='laion/clap-htsat-unfused'							, )
							# This is an audio of a dog
							_SCREAMING_SNAKE_CASE							   =load_dataset('ashraq/esc50'			)
							_SCREAMING_SNAKE_CASE							   =dataset['train']['audio'][-1]['array']
							_SCREAMING_SNAKE_CASE							   =audio_classifier(lowerCAmelCase_							, candidate_labels=['Sound of a dog', 'Sound of vaccum cleaner']			)

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

							_SCREAMING_SNAKE_CASE							   =audio_classifier([audio] * 5							, candidate_labels=['Sound of a dog', 'Sound of vaccum cleaner']			)
							self.assertEqual(
							    nested_simplify(lowerCAmelCase_			)							, [
							        [
							            {'score': 0.9_99, 'label': 'Sound of a dog'},
							            {'score': 0.0_01, 'label': 'Sound of vaccum cleaner'},
							        ],
							    ]
							    * 5							, )
							_SCREAMING_SNAKE_CASE							   =audio_classifier(
							    [audio] * 5							, candidate_labels=['Sound of a dog', 'Sound of vaccum cleaner']							, batch_size=5			)
							self.assertEqual(
							    nested_simplify(lowerCAmelCase_			)							, [
							        [
							            {'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 						A  (		self				:     Tuple			)     ->   Optional[Any]:





							'''simple docstring'''






							pass



'''simple docstring'''
from __future__ import annotations

from fractions import Fraction
from math import gcd, sqrt


def 	_lowerCAmelCase (						_UpperCamelCase						:					int    )				->      bool:
     """simple docstring"""




     _SCREAMING_SNAKE_CASE							   =int(number**0.5    )
     return number == sq * sq


def 	_lowerCAmelCase (						_UpperCamelCase						:					int							,			_UpperCamelCase						:					int							,			_UpperCamelCase						:					int							,			_UpperCamelCase						:					int							,			_UpperCamelCase						:					int							,			_UpperCamelCase						:					int    )				->      tuple[int, int]:
     """simple docstring"""




     _SCREAMING_SNAKE_CASE							   =x_num * y_den * z_den + y_num * x_den * z_den + z_num * x_den * y_den
     _SCREAMING_SNAKE_CASE							   =x_den * y_den * z_den
     _SCREAMING_SNAKE_CASE							   =gcd(_UpperCamelCase							,			_UpperCamelCase    )
     top //= hcf
     bottom //= hcf
     return top, bottom


def 	_lowerCAmelCase (						_UpperCamelCase						:					int = 35    )				->      int:
     """simple docstring"""




     _SCREAMING_SNAKE_CASE							   =set()
     _SCREAMING_SNAKE_CASE							   =42
     _SCREAMING_SNAKE_CASE							   =Fraction(0    )
     _SCREAMING_SNAKE_CASE							   =42

     for x_num in range(1							,			order + 1    ):
          for x_den in range(x_num + 1							,			order + 1    ):
               for y_num in range(1							,			order + 1    ):
                    for y_den in range(y_num + 1							,			order + 1    ):
                         # n=1
                         _SCREAMING_SNAKE_CASE							   =x_num * y_den + x_den * y_num
                         _SCREAMING_SNAKE_CASE							   =x_den * y_den
                         _SCREAMING_SNAKE_CASE							   =gcd(_UpperCamelCase							,			_UpperCamelCase    )
                         z_num //= hcf
                         z_den //= hcf
                         if 0 < z_num < z_den <= order:
                              _SCREAMING_SNAKE_CASE							   =add_three(
                                  _UpperCamelCase							,			_UpperCamelCase							,			_UpperCamelCase							,			_UpperCamelCase							,			_UpperCamelCase							,			_UpperCamelCase    )
                              unique_s.add(_UpperCamelCase    )

                         # n=2
                         _SCREAMING_SNAKE_CASE							   =(
                             x_num * x_num * y_den * y_den + x_den * x_den * y_num * y_num
                         )
                         _SCREAMING_SNAKE_CASE							   =x_den * x_den * y_den * y_den
                         if is_sq(_UpperCamelCase    ) and is_sq(_UpperCamelCase    ):
                              _SCREAMING_SNAKE_CASE							   =int(sqrt(_UpperCamelCase    )    )
                              _SCREAMING_SNAKE_CASE							   =int(sqrt(_UpperCamelCase    )    )
                              _SCREAMING_SNAKE_CASE							   =gcd(_UpperCamelCase							,			_UpperCamelCase    )
                              z_num //= hcf
                              z_den //= hcf
                              if 0 < z_num < z_den <= order:
                                   _SCREAMING_SNAKE_CASE							   =add_three(
                                       _UpperCamelCase							,			_UpperCamelCase							,			_UpperCamelCase							,			_UpperCamelCase							,			_UpperCamelCase							,			_UpperCamelCase    )
                                   unique_s.add(_UpperCamelCase    )

                    # n=-1
                         _SCREAMING_SNAKE_CASE							   =x_num * y_num
                         _SCREAMING_SNAKE_CASE							   =x_den * y_num + x_num * y_den
                         _SCREAMING_SNAKE_CASE							   =gcd(_UpperCamelCase							,			_UpperCamelCase    )
                         z_num //= hcf
                         z_den //= hcf
                         if 0 < z_num < z_den <= order:
                              _SCREAMING_SNAKE_CASE							   =add_three(
                                  _UpperCamelCase							,			_UpperCamelCase							,			_UpperCamelCase							,			_UpperCamelCase							,			_UpperCamelCase							,			_UpperCamelCase    )
                              unique_s.add(_UpperCamelCase    )

                         # n=2
                         _SCREAMING_SNAKE_CASE							   =x_num * x_num * y_num * y_num
                         _SCREAMING_SNAKE_CASE							   =(
                             x_den * x_den * y_num * y_num + x_num * x_num * y_den * y_den
                         )
                         if is_sq(_UpperCamelCase    ) and is_sq(_UpperCamelCase    ):
                              _SCREAMING_SNAKE_CASE							   =int(sqrt(_UpperCamelCase    )    )
                              _SCREAMING_SNAKE_CASE							   =int(sqrt(_UpperCamelCase    )    )
                              _SCREAMING_SNAKE_CASE							   =gcd(_UpperCamelCase							,			_UpperCamelCase    )
                              z_num //= hcf
                              z_den //= hcf
                              if 0 < z_num < z_den <= order:
                                   _SCREAMING_SNAKE_CASE							   =add_three(
                                       _UpperCamelCase							,			_UpperCamelCase							,			_UpperCamelCase							,			_UpperCamelCase							,			_UpperCamelCase							,			_UpperCamelCase    )
                                   unique_s.add(_UpperCamelCase    )

     for num, den in unique_s:
          total += Fraction(_UpperCamelCase							,			_UpperCamelCase    )

     return total.denominator + total.numerator


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