




import csv

import tweepy

# Twitter API credentials
lowerCamelCase__			:       Tuple         =							''
lowerCamelCase__			:       str         =							''
lowerCamelCase__			:       int         =							''
lowerCamelCase__			:       List[str]         =							''

def  UpperCAmelCase_							(				__UpperCAmelCase						:     str							) ->			None:
      # authorize twitter, initialize tweepy
      SCREAMING_SNAKE_CASE_     						=      tweepy.OAuthHandler(__UpperCAmelCase      ,      __UpperCAmelCase							)
      auth.set_access_token(__UpperCAmelCase      ,      __UpperCAmelCase							)
      SCREAMING_SNAKE_CASE_     						=      tweepy.API(__UpperCAmelCase							)

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

      # make initial request for most recent tweets (200 is the maximum allowed count)
      SCREAMING_SNAKE_CASE_     						=      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
      SCREAMING_SNAKE_CASE_     						=      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
            SCREAMING_SNAKE_CASE_     						=      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
            SCREAMING_SNAKE_CASE_     						=      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
      SCREAMING_SNAKE_CASE_     						=      [[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:
            SCREAMING_SNAKE_CASE_     						=      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')





def  UpperCAmelCase_							(				__UpperCAmelCase						:     int      ,      __UpperCAmelCase						:     int							) ->			int:
      return int((input_a, input_a).count(0							) != 0							)

def  UpperCAmelCase_							(				) ->			None:
      assert nand_gate(0      ,      0							) == 1
      assert nand_gate(0      ,      1							) == 1
      assert nand_gate(1      ,      0							) == 1
      assert nand_gate(1      ,      1							) == 0


if __name__ == "__main__":
   print(nand_gate(0, 0))
   print(nand_gate(0, 1))
   print(nand_gate(1, 0))
   print(nand_gate(1, 1))