


from math import isclose, sqrt





def __UpperCAmelCase       (		__A ,						__A ,						__A			)						->					tuple[float, float, float]:



  '''simple docstring'''





  UpperCAmelCase__										=     point_y / 4 / point_x
  UpperCAmelCase__										=     2 * normal_gradient / (1 + normal_gradient * normal_gradient)
  UpperCAmelCase__										=     (1 - normal_gradient * normal_gradient) / (
      1 + normal_gradient * normal_gradient
  )
  UpperCAmelCase__										=     (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__										=     outgoing_gradient**2 + 4
  UpperCAmelCase__										=     2 * outgoing_gradient * (point_y - outgoing_gradient * point_x)
  UpperCAmelCase__										=     (point_y - outgoing_gradient * point_x) ** 2 - 1_0_0

  UpperCAmelCase__										=     (
      -linear_term - sqrt(linear_term**2 - 4 * quadratic_term * constant_term			)
  ) / (2 * quadratic_term)
  UpperCAmelCase__										=     (
      -linear_term + sqrt(linear_term**2 - 4 * quadratic_term * constant_term			)
  ) / (2 * quadratic_term)

  # two solutions, one of which is our input point
  UpperCAmelCase__										=     x_minus if isclose(__A ,						__A			) else x_plus
  UpperCAmelCase__										=     point_y + outgoing_gradient * (next_x - point_x)

  return next_x, next_y, outgoing_gradient





def __UpperCAmelCase       (		__A = 1.4 ,						__A = -9.6			)						->					int:



  '''simple docstring'''





  UpperCAmelCase__										=     0
  UpperCAmelCase__										=     first_x_coord
  UpperCAmelCase__										=     first_y_coord
  UpperCAmelCase__										=     (10.1 - point_y) / (0.0 - point_x)

  while not (-0.01 <= point_x <= 0.01 and point_y > 0):
    UpperCAmelCase__						,			UpperCAmelCase__						,			UpperCAmelCase__										=     next_point(__A ,						__A ,						__A			)
    num_reflections += 1

  return num_reflections


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









import csv

import tweepy

# Twitter API credentials
A      = ""
A      = ""
A      = ""
A      = ""





def __UpperCAmelCase       (		__A			)						->					None:



       '''simple docstring'''





       UpperCAmelCase__										=     tweepy.OAuthHandler(__A ,						__A			)
       auth.set_access_token(__A ,						__A			)
       UpperCAmelCase__										=     tweepy.API(__A			)

       # initialize a list to hold all the tweepy Tweets
       UpperCAmelCase__										=     []

       # make initial request for most recent tweets (200 is the maximum allowed count)
       UpperCAmelCase__										=     api.user_timeline(screen_name=__A ,						count=2_0_0			)

       # save most recent tweets
       alltweets.extend(__A			)

       # save the id of the oldest tweet less one
       UpperCAmelCase__										=     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__										=     api.user_timeline(
                  screen_name=__A ,						count=2_0_0 ,						max_id=__A			)

              # save most recent tweets
              alltweets.extend(__A			)

              # update the id of the oldest tweet less one
              UpperCAmelCase__										=     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__										=     [[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__										=     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")





