
import csv

import tweepy

# Twitter API credentials
__a  			=					''
__a  			=					''
__a  			=					''
__a  			=					''




def 				a						(							snake_case__:					str					):


				'''simple docstring'''
				# authorize twitter, initialize tweepy
				lowercase_       =					tweepy.OAuthHandler(snake_case__						,   snake_case__					)
				auth.set_access_token(snake_case__						,   snake_case__					)
				lowercase_       =					tweepy.API(snake_case__					)

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

				# make initial request for most recent tweets (200 is the maximum allowed count)
				lowercase_       =					api.user_timeline(screen_name=snake_case__						,   count=200					)

				# save most recent tweets
				alltweets.extend(snake_case__					)

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

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

								# all subsequent requests use the max_id param to prevent duplicates
								lowercase_       =					api.user_timeline(
								    screen_name=snake_case__						,   count=200						,   max_id=snake_case__					)

								# save most recent tweets
								alltweets.extend(snake_case__					)

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

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

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


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






def 				a						(							snake_case__:					list					):


				'''simple docstring'''

				if len(snake_case__					) <= 1:
								return [tuple(snake_case__					)]

				lowercase_       =					[]

				def generate(snake_case__:					int						,   snake_case__:					list					):
								if k == 1:
												res.append(tuple(arr[:]					)					)
												return

								generate(k - 1						,   snake_case__					)

								for i in range(k - 1					):
												if k % 2 == 0:  # k is even
																lowercase_  ,	lowercase_       =					arr[k - 1], arr[i]
												else:  # k is odd
																lowercase_  ,	lowercase_       =					arr[k - 1], arr[0]
												generate(k - 1						,   snake_case__					)

				generate(len(snake_case__					)						,   snake_case__					)
				return res


if __name__ == "__main__":
						__a  			=					input('Enter numbers separated by a comma:\n').strip()
						__a  			=					[int(item) for item in user_input.split(',')]
						print(heaps(arr))




