


'''simple docstring'''
import math


def 			a      (			__a ,					__a = 0 ,					__a = 0   )  ->	list:



					'''simple docstring'''






					UpperCamelCase__   :Dict												= end or len(__a   )
					for i in range(__a ,					__a   ):
										UpperCamelCase__   :Tuple												= i
										UpperCamelCase__   :Union[str, Any]												= array[i]
										while temp_index != start and temp_index_value < array[temp_index - 1]:
															UpperCamelCase__   :Any												= array[temp_index - 1]
															temp_index -= 1
										UpperCamelCase__   :Union[str, Any]												= temp_index_value
					return array


def 			a      (			__a ,					__a ,					__a   )  ->	None:  # Max Heap



					'''simple docstring'''






					UpperCamelCase__   :Dict												= index
					UpperCamelCase__   :Optional[Any]												= 2 * index + 1  # Left Node
					UpperCamelCase__   :Union[str, Any]												= 2 * index + 2  # Right Node

					if left_index < heap_size and array[largest] < array[left_index]:
										UpperCamelCase__   :Any												= left_index

					if right_index < heap_size and array[largest] < array[right_index]:
										UpperCamelCase__   :Dict												= right_index

					if largest != index:
										UpperCamelCase__					,				UpperCamelCase__   :Tuple												= array[largest], array[index]
										heapify(__a ,					__a ,					__a   )


def 			a      (			__a   )  ->	list:



					'''simple docstring'''






					UpperCamelCase__   :List[str]												= len(__a   )

					for i in range(n // 2 ,					-1 ,					-1   ):
										heapify(__a ,					__a ,					__a   )

					for i in range(n - 1 ,					0 ,					-1   ):
										UpperCamelCase__					,				UpperCamelCase__   :Union[str, Any]												= array[0], array[i]
										heapify(__a ,					0 ,					__a   )

					return array


def 			a      (			__a ,					__a ,					__a ,					__a   )  ->	int:



					'''simple docstring'''






					if (array[first_index] > array[middle_index]) != (
					    array[first_index] > array[last_index]
					):
										return array[first_index]
					elif (array[middle_index] > array[first_index]) != (
					    array[middle_index] > array[last_index]
					):
										return array[middle_index]
					else:
										return array[last_index]


def 			a      (			__a ,					__a ,					__a ,					__a   )  ->	int:



					'''simple docstring'''






					UpperCamelCase__   :str												= low
					UpperCamelCase__   :Dict												= high
					while True:
										while array[i] < pivot:
															i += 1
										j -= 1
										while pivot < array[j]:
															j -= 1
										if i >= j:
															return i
										UpperCamelCase__					,				UpperCamelCase__   :int												= array[j], array[i]
										i += 1


def 			a      (			__a   )  ->	list:



					'''simple docstring'''






					if len(__a   ) == 0:
										return array
					UpperCamelCase__   :Tuple												= 2 * math.ceil(math.loga(len(__a   )   )   )
					UpperCamelCase__   :Optional[Any]												= 16
					return intro_sort(__a ,					0 ,					len(__a   ) ,					__a ,					__a   )


def 			a      (			__a ,					__a ,					__a ,					__a ,					__a   )  ->	list:



					'''simple docstring'''






					while end - start > size_threshold:
										if max_depth == 0:
															return heap_sort(__a   )
										max_depth -= 1
										UpperCamelCase__   :Any												= median_of_a(__a ,					__a ,					start + ((end - start) // 2) + 1 ,					end - 1   )
										UpperCamelCase__   :int												= partition(__a ,					__a ,					__a ,					__a   )
										intro_sort(__a ,					__a ,					__a ,					__a ,					__a   )
										UpperCamelCase__   :Union[str, Any]												= p
					return insertion_sort(__a ,					__a ,					__a   )


if __name__ == "__main__":
		import doctest

		doctest.testmod()

		__snake_case							      =     input('''Enter numbers separated by a comma : ''').strip()
		__snake_case							      =     [float(item) for item in user_input.split(''',''')]
		print(sort(unsorted))



'''simple docstring'''
import csv

import tweepy

# Twitter API credentials
__snake_case							      =     ''''''
__snake_case							      =     ''''''
__snake_case							      =     ''''''
__snake_case							      =     ''''''


def 			a      (			__a   )  ->	None:



					'''simple docstring'''






					UpperCamelCase__   :List[Any]												= tweepy.OAuthHandler(__a ,					__a   )
					auth.set_access_token(__a ,					__a   )
					UpperCamelCase__   :List[str]												= tweepy.API(__a   )

					# initialize a list to hold all the tweepy Tweets
					UpperCamelCase__   :Dict												= []

					# make initial request for most recent tweets (200 is the maximum allowed count)
					UpperCamelCase__   :Tuple												= api.user_timeline(screen_name=__a ,					count=200   )

					# save most recent tweets
					alltweets.extend(__a   )

					# save the id of the oldest tweet less one
					UpperCamelCase__   :Union[str, Any]												= 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__   :Union[str, Any]												= api.user_timeline(
										    screen_name=__a ,					count=200 ,					max_id=__a   )

										# save most recent tweets
										alltweets.extend(__a   )

										# update the id of the oldest tweet less one
										UpperCamelCase__   :Tuple												= 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__   :int												= [[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__   :Tuple												= 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''')