

from __future__ import annotations






class _UpperCamelCase				:
			'''simple docstring'''







			def __init__(      self				:			Optional[int]   ,   a				:			int						)				->							None:

				"""simple docstring"""

				SCREAMING_SNAKE_CASE :   Dict					  =							order

				# a_{0} ... a_{k}
				SCREAMING_SNAKE_CASE :   List[Any]					  =							[1.0] + [0.0] * order
				# b_{0} ... b_{k}
				SCREAMING_SNAKE_CASE :   List[str]					  =							[1.0] + [0.0] * order

				# x[n-1] ... x[n-k]
				SCREAMING_SNAKE_CASE :   Dict					  =							[0.0] * self.order
				# y[n-1] ... y[n-k]
				SCREAMING_SNAKE_CASE :   Tuple					  =							[0.0] * self.order
			def 				__UpperCamelCase			(      self				:			List[str]   ,   a				:			list[float]   ,   a				:			list[float]						)				->							None:

				"""simple docstring"""

				if len(a						) < self.order:
					SCREAMING_SNAKE_CASE :   int					  =							[1.0, *a_coeffs]

				if len(a						) != self.order + 1:
					SCREAMING_SNAKE_CASE :   List[Any]					  =							(
					    F"Expected a_coeffs to have {self.order + 1} elements "
					    F"for {self.order}-order filter, got {len(a						)}"
					)
					raise ValueError(a						)

				if len(a						) != self.order + 1:
					SCREAMING_SNAKE_CASE :   str					  =							(
					    F"Expected b_coeffs to have {self.order + 1} elements "
					    F"for {self.order}-order filter, got {len(a						)}"
					)
					raise ValueError(a						)

				SCREAMING_SNAKE_CASE :   Union[str, Any]					  =							a_coeffs
				SCREAMING_SNAKE_CASE :   List[Any]					  =							b_coeffs






			def 				__UpperCamelCase			(      self				:			Optional[int]   ,   a				:			float						)				->							float:

				"""simple docstring"""

				SCREAMING_SNAKE_CASE :   int					  =							0.0

				# Start at index 1 and do index 0 at the end.
				for i in range(1   ,   self.order + 1						):
					result += (
					    self.b_coeffs[i] * self.input_history[i - 1]
					    - self.a_coeffs[i] * self.output_history[i - 1]
					)

				SCREAMING_SNAKE_CASE :   int					  =							(result + self.b_coeffs[0] * sample) / self.a_coeffs[0]

				SCREAMING_SNAKE_CASE :   List[Any]					  =							self.input_history[:-1]
				SCREAMING_SNAKE_CASE :   List[str]					  =							self.output_history[:-1]

				SCREAMING_SNAKE_CASE :   Any					  =							sample
				SCREAMING_SNAKE_CASE :   List[str]					  =							result

				return result


from __future__ import annotations

def 			lowerCamelCase__			(       _a):
	if len(_a) == 0:
		return []
	SCREAMING_SNAKE_CASE  ,SCREAMING_SNAKE_CASE :   Tuple					  =							min(_a), max(_a)
	SCREAMING_SNAKE_CASE :   Dict					  =							int(max_value - min_value) + 1
	SCREAMING_SNAKE_CASE :   list[list]					  =							[[] for _ in range(_a)]

	for i in my_list:
		buckets[int(i - min_value)].append(_a)

	return [v for bucket in buckets for v in sorted(_a)]


if __name__ == "__main__":
			from doctest import testmod

			testmod()
			assert bucket_sort([4, 5, 3, 2, 1]) == [1, 2, 3, 4, 5]
			assert bucket_sort([0, 1, -10, 15, 2, -2]) == [-10, -2, 0, 1, 2, 15]