




'''simple docstring'''





import shutil

import requests


def 				_a       (				lowerCAmelCase						,	lowerCAmelCase = False						,	lowerCAmelCase = "."   )->  dict:
		SCREAMING_SNAKE_CASE_							=       'https://api.nasa.gov/planetary/apod'
		return requests.get(lowerCAmelCase						,	params={'api_key': api_key}   ).json()


def 				_a       (				lowerCAmelCase						,	lowerCAmelCase = "."   )->  dict:
		SCREAMING_SNAKE_CASE_							=       get_apod_data(lowerCAmelCase   )
		SCREAMING_SNAKE_CASE_							=       apod_data['url']
		SCREAMING_SNAKE_CASE_							=       img_url.split('/'   )[-1]
		SCREAMING_SNAKE_CASE_							=       requests.get(lowerCAmelCase						,	stream=lowerCAmelCase   )

		with open(F'''{path}/{img_name}'''						,	'wb+'   ) as img_file:
				shutil.copyfileobj(response.raw						,	lowerCAmelCase   )
		del response
		return apod_data


def 				_a       (				lowerCAmelCase   )->  dict:
		SCREAMING_SNAKE_CASE_							=       'https://images-api.nasa.gov/search'
		return requests.get(lowerCAmelCase						,	params={'q': query}   ).json()


if __name__ == "__main__":
						print(save_apod('''YOUR API KEY'''))
						SCREAMING_SNAKE_CASE:    Union[str, Any]											=   get_archive_data('''apollo 2011''')['''collection''']['''items''']
						print(apollo_aaaa_items[0]['''data'''][0]['''description'''])





from __future__ import annotations


def 				_a       (				lowerCAmelCase						,	lowerCAmelCase   )->  int:
		SCREAMING_SNAKE_CASE_			,							SCREAMING_SNAKE_CASE_							=       0, len(lowerCAmelCase   ) - 1
		while start_ind <= end_ind:
				if array[start_ind] == search_item:
						return start_ind
				elif array[end_ind] == search_item:
						return end_ind
				else:
						start_ind += 1
						end_ind -= 1
    # returns -1 if search_item is not found in array
		return -1


if __name__ == "__main__":
						print(double_linear_search(list(range(1_0_0)), 4_0))