





import csv

import tweepy

# Twitter API credentials
__UpperCamelCase:	str = """"""
__UpperCamelCase:	Union[str, Any] = """"""
__UpperCamelCase:	int = """"""
__UpperCamelCase:	List[Any] = """"""


def       SCREAMING_SNAKE_CASE__  (       _lowercase     : str			)   ->							None:




		'''simple docstring'''
		# authorize twitter, initialize tweepy
		lowercase__					:      Tuple      =		tweepy.OAuthHandler(_lowercase   ,    _lowercase			)
		auth.set_access_token(_lowercase   ,    _lowercase			)
		lowercase__					:      int      =		tweepy.API(_lowercase			)

		# initialize a list to hold all the tweepy Tweets
		lowercase__					:      Optional[Any]      =		[]

		# make initial request for most recent tweets (200 is the maximum allowed count)
		lowercase__					:      List[str]      =		api.user_timeline(screen_name=_lowercase   ,    count=200			)

		# save most recent tweets
		alltweets.extend(_lowercase			)

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

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

				# all subsequent requests use the max_id param to prevent duplicates
				lowercase__					:      int      =		api.user_timeline(
				    screen_name=_lowercase   ,    count=200   ,    max_id=_lowercase			)

				# save most recent tweets
				alltweets.extend(_lowercase			)

				# update the id of the oldest tweet less one
				lowercase__					:      Optional[Any]      =		alltweets[-1].id - 1

				print(f"""...{len(_lowercase			)} tweets downloaded so far"""			)

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


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









import numpy as np
from cva import destroyAllWindows, imread, imshow, waitKey


class       __lowerCAmelCase					:


	'''simple docstring'''





	def __init__(						self:						List[str],					lowerCamelCase_:						Optional[Any],					lowerCamelCase_:						int,					lowerCamelCase_:						int			):
			if dst_width < 0 or dst_height < 0:
					raise ValueError('Destination width/height should be > 0'			)

			lowercase__					:      str      =		img
			lowercase__					:      Tuple      =		img.shape[1]
			lowercase__					:      str      =		img.shape[0]
			lowercase__					:      Tuple      =		dst_width
			lowercase__					:      Any      =		dst_height

			lowercase__					:      Tuple      =		self.src_w / self.dst_w
			lowercase__					:      Union[str, Any]      =		self.src_h / self.dst_h

			lowercase__					:      List[Any]      =		(
			    np.ones((self.dst_h, self.dst_w, 3),					np.uinta			) * 255
			)

	def    snake_case__(						self:						Dict			):
			for i in range(self.dst_h			):
					for j in range(self.dst_w			):
							lowercase__					:      Tuple      =		self.img[self.get_y(lowerCamelCase_			)][self.get_x(lowerCamelCase_			)]

	def    snake_case__(						self:						List[str],					lowerCamelCase_:						int			):
			return int(self.ratio_x * x			)





	def    snake_case__(						self:						int,					lowerCamelCase_:						int			):
			return int(self.ratio_y * y			)


if __name__ == "__main__":
			__UpperCamelCase,	__UpperCamelCase:	List[Any] = 8_0_0, 6_0_0
			__UpperCamelCase:	Optional[Any] = imread("""image_data/lena.jpg""", 1)
			__UpperCamelCase:	Union[str, Any] = NearestNeighbour(im, dst_w, dst_h)
			n.process()

			imshow(
			    F'Image resized from: {im.shape[1]}x{im.shape[0]} to {dst_w}x{dst_h}', n.output
			)
			waitKey(0)
			destroyAllWindows()


