


"""simple docstring"""







import shutil

import requests






def 					a__ (       _UpperCamelCase	,			_UpperCamelCase = False	,			_UpperCamelCase = "." ):





						"""simple docstring"""

						UpperCAmelCase__		=    '''https://api.nasa.gov/planetary/apod'''
						return requests.get(_UpperCamelCase	,			params={'''api_key''': api_key} ).json()






def 					a__ (       _UpperCamelCase	,			_UpperCamelCase = "." ):





						"""simple docstring"""

						UpperCAmelCase__		=    get_apod_data(_UpperCamelCase )
						UpperCAmelCase__		=    apod_data['''url''']
						UpperCAmelCase__		=    img_url.split('''/''' )[-1]
						UpperCAmelCase__		=    requests.get(_UpperCamelCase	,			stream=_UpperCamelCase )

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






def 					a__ (       _UpperCamelCase ):





						"""simple docstring"""

						UpperCAmelCase__		=    '''https://images-api.nasa.gov/search'''
						return requests.get(_UpperCamelCase	,			params={'''q''': query} ).json()


if __name__ == "__main__":
						print(save_apod("YOUR API KEY"))
						__a			 =   get_archive_data("apollo 2011")["collection"]["items"]
						print(apollo_aaaa_items[0]["data"][0]["description"])



"""simple docstring"""







from collections import defaultdict






def 					a__ (       _UpperCamelCase = 5 ):





						"""simple docstring"""

						UpperCAmelCase__		=    defaultdict(_UpperCamelCase )
						UpperCAmelCase__		=    0

						while True:
												UpperCAmelCase__		=    get_digits(_UpperCamelCase )
												freqs[digits].append(_UpperCamelCase )

												if len(freqs[digits] ) == max_base:
																		UpperCAmelCase__		=    freqs[digits][0] ** 3
																		return base

												num += 1






def 					a__ (       _UpperCamelCase ):





						"""simple docstring"""

						return "".join(sorted(str(num**3 ) ) )


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