




'''simple docstring'''


import requests

UpperCamelCase       			= 'YOUR API KEY'
def  SCREAMING_SNAKE_CASE(					__lowercase						,							__lowercase = giphy_api_key     )       ->      list:
     A:						Optional[Any]						=						'''+'''.join(query.split()     )
     A:						Tuple						=						F"""https://api.giphy.com/v1/gifs/search?q={formatted_query}&api_key={api_key}"""
     A:						str						=						requests.get(UpperCamelCase__     ).json()['''data''']
     return [gif["url"] for gif in gifs]


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













import random


def 	UpperCamelCase__(       UpperCamelCase__			:       list ,     UpperCamelCase__			:       List[Any]  )->tuple:
       A__					,	A__					,	A__											=						[], [], []
       for element in data:
              if element < pivot:
                     less.append(UpperCamelCase__  )
              elif element > pivot:
                     greater.append(UpperCamelCase__  )
              else:
                     equal.append(UpperCamelCase__  )
       return less, equal, greater


def 	UpperCamelCase__(       UpperCamelCase__			:       list ,     UpperCamelCase__			:       int  )->Optional[int]:
       # index = len(items) // 2 when trying to find the median
       #   (value of index when items is sorted)

       # invalid input
       if index >= len(UpperCamelCase__  ) or index < 0:
              return None

       A__											=						items[random.randint(0 ,     len(UpperCamelCase__  ) - 1  )]
       A__											=						0
       A__					,	A__					,	A__											=						_partition(UpperCamelCase__ ,     UpperCamelCase__  )
       A__											=						len(UpperCamelCase__  )
       A__											=						len(UpperCamelCase__  )

       # index is the pivot
       if m <= index < m + count:
              return pivot
       # must be in smaller
       elif m > index:
              return quick_select(UpperCamelCase__ ,     UpperCamelCase__  )
       # must be in larger
       else:
              return quick_select(UpperCamelCase__ ,     index - (m + count)  )





