"""simple docstring"""







from __future__ import annotations

from pathlib import Path


def 	a__   (		UpperCAmelCase__							:      tuple[int, int]		,      UpperCAmelCase__							:      tuple[int, int]      )->						int:
						return pointa[0] * pointa[1] - pointa[1] * pointa[0]


def 	a__   (		UpperCAmelCase__							:      int		,      UpperCAmelCase__							:      int		,      UpperCAmelCase__							:      int		,      UpperCAmelCase__							:      int		,      UpperCAmelCase__							:      int		,      UpperCAmelCase__							:      int      )->						bool:
						UpperCAmelCase__       						=		(xa, ya)
						UpperCAmelCase__       						=		(xa - xa, ya - ya)
						UpperCAmelCase__       						=		(xa - xa, ya - ya)
						UpperCAmelCase__       						=		-vector_product(UpperCAmelCase__		,      UpperCAmelCase__      ) / vector_product(
						    UpperCAmelCase__		,      UpperCAmelCase__      )
						UpperCAmelCase__       						=		+vector_product(UpperCAmelCase__		,      UpperCAmelCase__      ) / vector_product(
						    UpperCAmelCase__		,      UpperCAmelCase__      )

						return a > 0 and b > 0 and a + b < 1


def 	a__   (		UpperCAmelCase__							:      str = "p102_triangles.txt"      )->						int:
						UpperCAmelCase__       						=		Path(UpperCAmelCase__      ).parent.joinpath(UpperCAmelCase__      ).read_text(encoding="""utf-8"""      )

						UpperCAmelCase__       						=		[]
						for line in data.strip().split("""\n"""      ):
												triangles.append([int(UpperCAmelCase__      ) for number in line.split(""","""      )]      )

						UpperCAmelCase__       						=		0
						UpperCAmelCase__       						=		42

						for triangle in triangles:
												ret += contains_origin(*UpperCAmelCase__      )

						return ret


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


"""simple docstring"""







import shutil

import requests


def 	a__   (		UpperCAmelCase__							:      str		,      UpperCAmelCase__							:      bool = False		,      UpperCAmelCase__							:      str = "."      )->						dict:
						UpperCAmelCase__       						=		"""https://api.nasa.gov/planetary/apod"""
						return requests.get(UpperCAmelCase__		,      params={"""api_key""": api_key}      ).json()


def 	a__   (		UpperCAmelCase__							:      str		,      UpperCAmelCase__							:      str = "."      )->						dict:
						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__							:      str      )->						dict:
						UpperCAmelCase__       						=		"""https://images-api.nasa.gov/search"""
						return requests.get(UpperCAmelCase__		,      params={"""q""": query}      ).json()


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

