





'''simple docstring'''


from __future__ import annotations

from collections.abc import Callable
def       __snake_case		( SCREAMING_SNAKE_CASE_ :			Callable[[int | float], int | float]			,	SCREAMING_SNAKE_CASE_ :			int | float			,	SCREAMING_SNAKE_CASE_ :			int | float			,	SCREAMING_SNAKE_CASE_ :			int = 100			,	)							->     float:

       """simple docstring"""


       UpperCAmelCase  =						x_start
       UpperCAmelCase  =						fnc(SCREAMING_SNAKE_CASE_ )
       UpperCAmelCase  =						0.0
       for _ in range(SCREAMING_SNAKE_CASE_ ):
              # Approximates small segments of curve as linear and solve
              # for trapezoidal area
              UpperCAmelCase  =						(x_end - x_start) / steps + xa
              UpperCAmelCase  =						fnc(SCREAMING_SNAKE_CASE_ )
              area += abs(fxa + fxa ) * (xa - xa) / 2
              # Increment step
              UpperCAmelCase  =						xa
              UpperCAmelCase  =						fxa
       return area


if __name__ == "__main__":
    def       __snake_case		( SCREAMING_SNAKE_CASE_ :			Optional[Any] )							->     List[str]:

           """simple docstring"""


           return x**3 + x**2

    print('f(x) = x^3 + x^2')
    print('The area between the curve, x = -5, x = 5 and the x axis is:')
    a__			:					Union[str, Any]       						=						10
    while i <= 100_000:
        print(F"""with {i} steps: {trapezoidal_area(f, -5, 5, i)}""")
        i *= 10





'''simple docstring'''







import csv

import tweepy

# Twitter API credentials
__lowerCamelCase									=     ''''''
__lowerCamelCase									=     ''''''
__lowerCamelCase									=     ''''''
__lowerCamelCase									=     ''''''
def    UpperCAmelCase__     (   UpperCAmelCase__					)      ->      None:
       # authorize twitter, initialize tweepy
       A_						       =   tweepy.OAuthHandler(UpperCAmelCase__,							UpperCAmelCase__					)
       auth.set_access_token(UpperCAmelCase__,							UpperCAmelCase__					)
       A_						       =   tweepy.API(UpperCAmelCase__					)

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

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

       # save most recent tweets
       alltweets.extend(UpperCAmelCase__					)

       # save the id of the oldest tweet less one
       A_						       =   alltweets[-1].id - 1

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

              # all subsequent requests use the max_id param to prevent duplicates
              A_						       =   api.user_timeline(
                  screen_name=UpperCAmelCase__,							count=2_00,							max_id=UpperCAmelCase__					)

              # save most recent tweets
              alltweets.extend(UpperCAmelCase__					)

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

              print(F'''...{len(UpperCAmelCase__					)} tweets downloaded so far'''					)

       # transform the tweepy tweets into a 2D array that will populate the csv
       A_						       =   [[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:
              A_						       =   csv.writer(UpperCAmelCase__					)
              writer.writerow(["""id""", """created_at""", """text"""]					)
              writer.writerows(UpperCAmelCase__					)


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