




'''simple docstring'''


def 						snake_case_       (UpperCamelCase			:    Optional[int]					,		UpperCamelCase			:    List[Any] ):





							'''simple docstring'''


							_a      	=							0
							_a      	=							len(UpperCamelCase ) - 1

							while left <= right:
														# avoid divided by 0 during interpolation
														if sorted_collection[left] == sorted_collection[right]:
																					if sorted_collection[left] == item:
																												return left
																					else:
																												return None

														_a      	=							left + ((item - sorted_collection[left]) * (right - left)) // (
														    sorted_collection[right] - sorted_collection[left]
														)

														# out of range check
														if point < 0 or point >= len(UpperCamelCase ):
																					return None

														_a      	=							sorted_collection[point]
														if current_item == item:
																					return point
														else:
																					if point < left:
																												_a      	=							left
																												_a      	=							point
																					elif point > right:
																												_a      	=							right
																												_a      	=							point
																					else:
																												if item < current_item:
																																			_a      	=							point - 1
																												else:
																																			_a      	=							point + 1
							return None
def 						snake_case_       (UpperCamelCase			:    List[str]					,		UpperCamelCase			:    Tuple					,		UpperCamelCase			:    int					,		UpperCamelCase			:    List[str] ):





							'''simple docstring'''


							if sorted_collection[left] == sorted_collection[right]:
														if sorted_collection[left] == item:
																					return left
														else:
																					return None

							_a      	=							left + ((item - sorted_collection[left]) * (right - left)) // (
							    sorted_collection[right] - sorted_collection[left]
							)

							# out of range check
							if point < 0 or point >= len(UpperCamelCase ):
														return None

							if sorted_collection[point] == item:
														return point
							elif point < left:
														return interpolation_search_by_recursion(UpperCamelCase					,		UpperCamelCase					,		UpperCamelCase					,		UpperCamelCase )
							elif point > right:
														return interpolation_search_by_recursion(UpperCamelCase					,		UpperCamelCase					,		UpperCamelCase					,		UpperCamelCase )
							else:
														if sorted_collection[point] > item:
																					return interpolation_search_by_recursion(
																					    UpperCamelCase					,		UpperCamelCase					,		UpperCamelCase					,		point - 1 )
														else:
																					return interpolation_search_by_recursion(
																					    UpperCamelCase					,		UpperCamelCase					,		point + 1					,		UpperCamelCase )
def 						snake_case_       (UpperCamelCase			:    List[str] ):





							'''simple docstring'''


							if collection != sorted(UpperCamelCase ):
														raise ValueError('''Collection must be ascending sorted''' )
							return True


if __name__ == "__main__":
				import sys
				_snake_case : int  				=						0
				if debug == 1:
								_snake_case : Optional[int]  				=						[10, 30, 40, 45, 50, 66, 77, 93]
								try:
												__assert_sorted(collection)
								except ValueError:
												sys.exit('Sequence must be ascending sorted to apply interpolation search')
								_snake_case : Tuple  				=						67

				_snake_case : Tuple  				=						interpolation_search(collection, target)
				if result is not None:
								print(F'''{target} found at positions: {result}''')
				else:
								print('Not found')







'''simple docstring'''


import requests
def 						snake_case_       (UpperCamelCase			:    str					,		UpperCamelCase			:    str ):





							'''simple docstring'''


							_a      	=							{'''Content-Type''': '''application/json'''}
							_a      	=							requests.post(UpperCamelCase					,		json={'''text''': message_body}					,		headers=UpperCamelCase )
							if response.status_code != 200:
														_a      	=							(
														    '''Request to slack returned an error '''
														    f'{response.status_code}, the response is:\n{response.text}'
														)
														raise ValueError(UpperCamelCase )


if __name__ == "__main__":
				# Set the slack url to the one provided by Slack when you create the webhook at
				# https://my.slack.com/services/new/incoming-webhook/
				send_slack_message('<YOUR MESSAGE BODY>', '<SLACK CHANNEL URL>')

