


'''simple docstring'''







import shutil

import requests


def      SCREAMING_SNAKE_CASE_ (  _UpperCAmelCase     :     str   ,_UpperCAmelCase     :     bool = False   ,_UpperCAmelCase     :     str = "."  )  ->      dict:
       _a   :			Optional[int]					 ="""https://api.nasa.gov/planetary/apod"""
       return requests.get(_UpperCAmelCase   ,params={"""api_key""": api_key}  ).json()


def      SCREAMING_SNAKE_CASE_ (  _UpperCAmelCase     :     str   ,_UpperCAmelCase     :     str = "."  )  ->      dict:
       _a   :			Dict					 =get_apod_data(_UpperCAmelCase  )
       _a   :			Optional[int]					 =apod_data["""url"""]
       _a   :			str					 =img_url.split("""/"""  )[-1]
       _a   :			List[str]					 =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      SCREAMING_SNAKE_CASE_ (  _UpperCAmelCase     :     str  )  ->      dict:
       _a   :			Dict					 ="""https://images-api.nasa.gov/search"""
       return requests.get(_UpperCAmelCase   ,params={"""q""": query}  ).json()


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






'''simple docstring'''







import math


def      SCREAMING_SNAKE_CASE_ (  _UpperCAmelCase     :     int  )  ->      int:
       return sum(int(_UpperCAmelCase  ) for digit in str(_UpperCAmelCase  )  )


def      SCREAMING_SNAKE_CASE_ (  _UpperCAmelCase     :     int = 30  )  ->      int:
       _a   :			List[Any]					 =[]
       for digit in range(2   ,100  ):
              for power in range(2   ,100  ):
                     _a   :			Optional[Any]					 =int(math.pow(_UpperCAmelCase   ,_UpperCAmelCase  )  )
                     if digit == digit_sum(_UpperCAmelCase  ):
                            digit_to_powers.append(_UpperCAmelCase  )

       digit_to_powers.sort()
       return digit_to_powers[n - 1]


if __name__ == "__main__":
   print(solution())


