




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      ):







		'''simple docstring'''



		@require_torch
		def  __UpperCAmelCase      (							self       )     ->							Union[str, Any]:
							UpperCAmelCase_   :				Tuple						=						pipeline(
							    task='zero-shot-audio-classification'    ,		model='hf-internal-testing/tiny-clap-htsat-unfused'       )
							UpperCAmelCase_   :				Tuple						=						load_dataset('ashraq/esc50'       )
							UpperCAmelCase_   :				str						=						dataset['train']['audio'][-1]['array']
							UpperCAmelCase_   :				List[str]						=						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  __UpperCAmelCase      (							self       )     ->							int:
							pass



		@slow
		@require_torch
		def  __UpperCAmelCase      (							self       )     ->							List[Any]:
							UpperCAmelCase_   :				Optional[int]						=						pipeline(
							    task='zero-shot-audio-classification'    ,		model='laion/clap-htsat-unfused'    ,		)
							# This is an audio of a dog
							UpperCAmelCase_   :				Union[str, Any]						=						load_dataset('ashraq/esc50'       )
							UpperCAmelCase_   :				List[str]						=						dataset['train']['audio'][-1]['array']
							UpperCAmelCase_   :				Union[str, Any]						=						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'},
							    ]    ,		)

							UpperCAmelCase_   :				int						=						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    ,		)
							UpperCAmelCase_   :				Union[str, Any]						=						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  __UpperCAmelCase      (							self       )     ->							Tuple:
							pass














from collections import defaultdict
from math import ceil, sqrt




def 					lowercase__				(					__snake_case   :							int = 1_000_000					,	__snake_case   :							int = 10  ):


					'''simple docstring'''


					UpperCAmelCase_   :				defaultdict						=						defaultdict(__snake_case  )

					for outer_width in range(3					,	(t_limit // 4) + 2  ):
										if outer_width * outer_width > t_limit:
															UpperCAmelCase_   :				Union[str, Any]						=						max(
															    ceil(sqrt(outer_width * outer_width - t_limit  )  )					,	1  )
										else:
															UpperCAmelCase_   :				int						=						1

										hole_width_lower_bound += (outer_width - hole_width_lower_bound) % 2

										for hole_width in range(__snake_case					,	outer_width - 1					,	2  ):
															count[outer_width * outer_width - hole_width * hole_width] += 1

					return sum(1 for n in count.values() if 1 <= n <= 10  )


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






