

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


					'''simple docstring'''






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






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

						A__							:   str					       =		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   ,	)
						A__							:   List[str]					       =		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   __A      (			self      ):
						pass






import requests

A_	:			List[Any]  	=      'YOUR API KEY'

def 						UpperCamelCase (lowercase_:			str   ,				lowercase_:			str = giphy_api_key )					->				list:
	A__							:   Dict					       =		"""+""".join(query.split() )
	A__							:   Optional[int]					       =		f"""https://api.giphy.com/v1/gifs/search?q={formatted_query}&api_key={api_key}"""
	A__							:   Any					       =		requests.get(lowercase_ ).json()["""data"""]
	return [gif["url"] for gif in gifs]


if __name__ == "__main__":
	print('\n'.join(get_gifs('space ship')))



