





import numpy as np





def  a_       (							_lowercase ,		_lowercase     ):
						_UpperCamelCase    :      int						     =					np.array(_lowercase     )
						_UpperCamelCase    :      Optional[Any]						     =					np.array(_lowercase     )

						_UpperCamelCase    :      Any						     =					abs(predict - actual     )
						_UpperCamelCase    :      str						     =					difference.mean()

						return score





def  a_       (							_lowercase ,		_lowercase     ):
						_UpperCamelCase    :      Dict						     =					np.array(_lowercase     )
						_UpperCamelCase    :      Union[str, Any]						     =					np.array(_lowercase     )

						_UpperCamelCase    :      List[Any]						     =					predict - actual
						_UpperCamelCase    :      str						     =					np.square(_lowercase     )

						_UpperCamelCase    :      List[Any]						     =					square_diff.mean()
						return score





def  a_       (							_lowercase ,		_lowercase     ):
						_UpperCamelCase    :      Optional[Any]						     =					np.array(_lowercase     )
						_UpperCamelCase    :      Optional[int]						     =					np.array(_lowercase     )

						_UpperCamelCase    :      Optional[Any]						     =					predict - actual
						_UpperCamelCase    :      List[str]						     =					np.square(_lowercase     )
						_UpperCamelCase    :      Union[str, Any]						     =					square_diff.mean()
						_UpperCamelCase    :      Optional[Any]						     =					np.sqrt(_lowercase     )
						return score





def  a_       (							_lowercase ,		_lowercase     ):
						_UpperCamelCase    :      Union[str, Any]						     =					np.array(_lowercase     )
						_UpperCamelCase    :      List[Any]						     =					np.array(_lowercase     )

						_UpperCamelCase    :      Optional[int]						     =					np.log(predict + 1     )
						_UpperCamelCase    :      int						     =					np.log(actual + 1     )

						_UpperCamelCase    :      Dict						     =					log_predict - log_actual
						_UpperCamelCase    :      str						     =					np.square(_lowercase     )
						_UpperCamelCase    :      List[Any]						     =					square_diff.mean()

						_UpperCamelCase    :      List[Any]						     =					np.sqrt(_lowercase     )

						return score





def  a_       (							_lowercase ,		_lowercase     ):
						_UpperCamelCase    :      Union[str, Any]						     =					np.array(_lowercase     )
						_UpperCamelCase    :      Tuple						     =					np.array(_lowercase     )

						_UpperCamelCase    :      Optional[int]						     =					predict - actual
						_UpperCamelCase    :      List[Any]						     =					np.sum(_lowercase     ) / len(_lowercase     )
						_UpperCamelCase    :      Optional[Any]						     =					np.sum(_lowercase     ) / len(_lowercase     )
						# print(numerator, denumerator)
						_UpperCamelCase    :      Optional[Any]						     =					float(_lowercase     ) / denumerator * 100

						return score






def  a_       (							_lowercase ,		_lowercase     ):
						return np.mean(np.array(_lowercase     ) == np.array(_lowercase     )     )










"""simple docstring"""




def  a_       (							_lowercase     ):
						_UpperCamelCase    :      str						     =					len(_lowercase     )

						# Set the gap value to be decreased by a factor of 1.3
						# after each iteration
						_UpperCamelCase    :      str						     =					1.3

						# Continue sorting until the gap is 1
						while gap > 1:
												# Decrease the gap value
												_UpperCamelCase    :      Union[str, Any]						     =					int(gap / shrink     )

												# Sort the elements using insertion sort
												for i in range(_lowercase ,		len(_lowercase     )     ):
																		_UpperCamelCase    :      Optional[Any]						     =					collection[i]
																		_UpperCamelCase    :      int						     =					i
																		while j >= gap and collection[j - gap] > temp:
																								_UpperCamelCase    :      List[str]						     =					collection[j - gap]
																								j -= gap
																		_UpperCamelCase    :      Union[str, Any]						     =					temp

						return collection


if __name__ == "__main__":
						import doctest

						doctest.testmod()



