



def 	snake_case__       (					__lowercase							,     __lowercase       )		->		Dict:







						"""simple docstring"""

						A__	:							str						    = 0
						A__	:							List[Any]						    = len(__lowerCAmelCase       ) - 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__	:							str						    = left + ((item - sorted_collection[left]) * (right - left)) // (
												    sorted_collection[right] - sorted_collection[left]
												)

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

												A__	:							Union[str, Any]						    = sorted_collection[point]
												if current_item == item:
																		return point
												else:
																		if point < left:
																								A__	:							List[Any]						    = left
																								A__	:							Tuple						    = point
																		elif point > right:
																								A__	:							Dict						    = right
																								A__	:							Dict						    = point
																		else:
																								if item < current_item:
																														A__	:							Any						    = point - 1
																								else:
																														A__	:							Dict						    = point + 1
						return None
def 	snake_case__       (					__lowercase							,     __lowercase							,     __lowercase							,     __lowercase       )		->		Optional[Any]:







						"""simple docstring"""

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

						A__	:							Dict						    = left + ((item - sorted_collection[left]) * (right - left)) // (
						    sorted_collection[right] - sorted_collection[left]
						)

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

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







						"""simple docstring"""

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


if __name__ == "__main__":
		import sys
		snake_case    :						List[str]  =						0
		if debug == 1:
				snake_case    :						Dict  =						[1_0, 3_0, 4_0, 4_5, 5_0, 6_6, 7_7, 9_3]
				try:
						__assert_sorted(collection)
				except ValueError:
						sys.exit('Sequence must be ascending sorted to apply interpolation search')
				snake_case    :						Optional[int]  =						6_7

		snake_case    :						str  =						interpolation_search(collection, target)
		if result is not None:
				print(f"""{target} found at positions: {result}""")
		else:
				print('Not found')







import requests

snake_case    :						int  =						''  # <-- Put your OpenWeatherMap appid here!
snake_case    :						int  =						'https://api.openweathermap.org/data/2.5/'
def 	snake_case__       (					__lowercase = "Chicago"							,     __lowercase = APPID       )		->		dict:







						"""simple docstring"""

						return requests.get(URL_BASE + "weather"							,     params=locals()       ).json()
def 	snake_case__       (					__lowercase = "Kolkata, India"							,     __lowercase = APPID       )		->		dict:







						"""simple docstring"""

						return requests.get(URL_BASE + "forecast"							,     params=locals()       ).json()
def 	snake_case__       (					__lowercase = 55.68							,     __lowercase = 12.57							,     __lowercase = APPID       )		->		dict:







						"""simple docstring"""

						return requests.get(URL_BASE + "onecall"							,     params=locals()       ).json()


if __name__ == "__main__":
		from pprint import pprint

		while True:
				snake_case    :						int  =						input('Enter a location:').strip()
				if location:
						pprint(current_weather(location))
				else:
						break