






"""simple docstring"""





import shutil

import requests






def     A(  snake_case_						,       snake_case_ = False						,       snake_case_ = "."		):
       """simple docstring"""





       lowercase__:    List[str]        =      "https://api.nasa.gov/planetary/apod"
       return requests.get(snake_case_						,       params={"api_key": api_key}		).json()






def     A(  snake_case_						,       snake_case_ = "."		):
       """simple docstring"""





       lowercase__:    Union[str, Any]        =      get_apod_data(snake_case_		)
       lowercase__:    List[Any]        =      apod_data["url"]
       lowercase__:    int        =      img_url.split("/"		)[-1]
       lowercase__:    Optional[int]        =      requests.get(snake_case_						,       stream=snake_case_		)

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






def     A(  snake_case_		):
       """simple docstring"""





       lowercase__:    int        =      "https://images-api.nasa.gov/search"
       return requests.get(snake_case_						,       params={"q": query}		).json()


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














"""simple docstring"""





from __future__ import annotations






def     A(  snake_case_						,       snake_case_		):
       """simple docstring"""





       lowercase__  ,     lowercase__:    Optional[int]        =      0, len(snake_case_		) - 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_00)), 40))






