


'''simple docstring'''
from math import isclose, sqrt


def 			a      (			__a ,					__a ,					__a   )  ->	tuple[float, float, float]:



					'''simple docstring'''






					UpperCamelCase__   :List[str]												= point_y / 4 / point_x
					UpperCamelCase__   :str												= 2 * normal_gradient / (1 + normal_gradient * normal_gradient)
					UpperCamelCase__   :Dict												= (1 - normal_gradient * normal_gradient) / (
					    1 + normal_gradient * normal_gradient
					)
					UpperCamelCase__   :Tuple												= (sa - ca * incoming_gradient) / (ca + sa * incoming_gradient)

					# to find the next point, solve the simultaeneous equations:
					# y^2 + 4x^2 = 100
					# y - b = m * (x - a)
					# ==> A x^2 + B x + C = 0
					UpperCamelCase__   :Optional[int]												= outgoing_gradient**2 + 4
					UpperCamelCase__   :List[str]												= 2 * outgoing_gradient * (point_y - outgoing_gradient * point_x)
					UpperCamelCase__   :Optional[Any]												= (point_y - outgoing_gradient * point_x) ** 2 - 100

					UpperCamelCase__   :List[Any]												= (
					    -linear_term - sqrt(linear_term**2 - 4 * quadratic_term * constant_term   )
					) / (2 * quadratic_term)
					UpperCamelCase__   :Any												= (
					    -linear_term + sqrt(linear_term**2 - 4 * quadratic_term * constant_term   )
					) / (2 * quadratic_term)

					# two solutions, one of which is our input point
					UpperCamelCase__   :int												= x_minus if isclose(__a ,					__a   ) else x_plus
					UpperCamelCase__   :List[Any]												= point_y + outgoing_gradient * (next_x - point_x)

					return next_x, next_y, outgoing_gradient


def 			a      (			__a = 1.4 ,					__a = -9.6   )  ->	int:



					'''simple docstring'''






					UpperCamelCase__   :int												= 0
					UpperCamelCase__   :float												= first_x_coord
					UpperCamelCase__   :float												= first_y_coord
					UpperCamelCase__   :float												= (1_0.1 - point_y) / (0.0 - point_x)

					while not (-0.0_1 <= point_x <= 0.0_1 and point_y > 0):
										UpperCamelCase__					,				UpperCamelCase__					,				UpperCamelCase__   :Dict												= next_point(__a ,					__a ,					__a   )
										num_reflections += 1

					return num_reflections


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



'''simple docstring'''
import csv

import tweepy

# Twitter API credentials
__snake_case							      =     ''''''
__snake_case							      =     ''''''
__snake_case							      =     ''''''
__snake_case							      =     ''''''


def 			a      (			__a   )  ->	None:



					'''simple docstring'''






					UpperCamelCase__   :List[Any]												= tweepy.OAuthHandler(__a ,					__a   )
					auth.set_access_token(__a ,					__a   )
					UpperCamelCase__   :List[str]												= tweepy.API(__a   )

					# initialize a list to hold all the tweepy Tweets
					UpperCamelCase__   :Dict												= []

					# make initial request for most recent tweets (200 is the maximum allowed count)
					UpperCamelCase__   :Tuple												= api.user_timeline(screen_name=__a ,					count=200   )

					# save most recent tweets
					alltweets.extend(__a   )

					# save the id of the oldest tweet less one
					UpperCamelCase__   :Union[str, Any]												= alltweets[-1].id - 1

					# keep grabbing tweets until there are no tweets left to grab
					while len(__a   ) > 0:
										print(f'''getting tweets before {oldest}'''   )

										# all subsequent requests use the max_id param to prevent duplicates
										UpperCamelCase__   :Union[str, Any]												= api.user_timeline(
										    screen_name=__a ,					count=200 ,					max_id=__a   )

										# save most recent tweets
										alltweets.extend(__a   )

										# update the id of the oldest tweet less one
										UpperCamelCase__   :Tuple												= alltweets[-1].id - 1

										print(f'''...{len(__a   )} tweets downloaded so far'''   )

					# transform the tweepy tweets into a 2D array that will populate the csv
					UpperCamelCase__   :int												= [[tweet.id_str, tweet.created_at, tweet.text] for tweet in alltweets]

					# write the csv
					with open(f'''new_{screen_name}_tweets.csv''' ,					'''w'''   ) as f:
										UpperCamelCase__   :Tuple												= csv.writer(__a   )
										writer.writerow(['''id''', '''created_at''', '''text''']   )
										writer.writerows(__a   )


if __name__ == "__main__":
		# pass in the username of the account you want to download
		get_all_tweets('''FirePing32''')