


from math import factorial





def __UpperCAmelCase       (		__A ,						__A			)						->					int:



       '''simple docstring'''





       if n < k or k < 0:
              raise ValueError("Please enter positive integers for n and k where n >= k"			)
       return factorial(__A			) // (factorial(__A			) * factorial(n - k			))


if __name__ == "__main__":
    print(
        "The number of five-card hands possible from a standard",
        f"fifty-two card deck is: {combinations(52, 5)}\n",
    )

    print(
        "If a class of 40 students must be arranged into groups of",
        f"4 for group projects, there are {combinations(40, 4)} ways",
        "to arrange them.\n",
    )

    print(
        "If 10 teams are competing in a Formula One race, there",
        f"are {combinations(10, 3)} ways that first, second and",
        "third place can be awarded.",
    )









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")





