


def 		lowercase_	(  _UpperCamelCase							,      _UpperCamelCase = False	):


			'''simple docstring'''







			if not isinstance(_UpperCamelCase							,      _UpperCamelCase	):
						__lowercase			       = F'Expected string as input, found {type(_UpperCamelCase	)}'
						raise ValueError(_UpperCamelCase	)
			if not isinstance(_UpperCamelCase							,      _UpperCamelCase	):
						__lowercase			       = F'Expected boolean as use_pascal parameter, found {type(_UpperCamelCase	)}'
						raise ValueError(_UpperCamelCase	)

			__lowercase			       = input_str.split('''_'''	)

			__lowercase			       = 0 if use_pascal else 1

			__lowercase			       = words[start_index:]

			__lowercase			       = [word[0].upper() + word[1:] for word in words_to_capitalize]

			__lowercase			       = '''''' if use_pascal else words[0]

			return "".join([initial_word, *capitalized_words]	)


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

	testmod()






from __future__ import annotations
class 						lowerCamelCase_							:



					'''simple docstring'''







					def __init__(					self			,							snake_case_    ) ->      None:







								'''simple docstring'''

								__lowercase			       = order

								# a_{0} ... a_{k}
								__lowercase			       = [1.0] + [0.0] * order
								# b_{0} ... b_{k}
								__lowercase			       = [1.0] + [0.0] * order

								# x[n-1] ... x[n-k]
								__lowercase			       = [0.0] * self.order
								# y[n-1] ... y[n-k]
								__lowercase			       = [0.0] * self.order






					def A   (					self			,							snake_case_			,							snake_case_    ) ->      None:







								'''simple docstring'''

								if len(snake_case_    ) < self.order:
											__lowercase			       = [1.0, *a_coeffs]

								if len(snake_case_    ) != self.order + 1:
											__lowercase			       = (
											    F'Expected a_coeffs to have {self.order + 1} elements '
											    F'for {self.order}-order filter, got {len(snake_case_    )}'
											)
											raise ValueError(snake_case_    )

								if len(snake_case_    ) != self.order + 1:
											__lowercase			       = (
											    F'Expected b_coeffs to have {self.order + 1} elements '
											    F'for {self.order}-order filter, got {len(snake_case_    )}'
											)
											raise ValueError(snake_case_    )

								__lowercase			       = a_coeffs
								__lowercase			       = b_coeffs






					def A   (					self			,							snake_case_    ) ->      float:







								'''simple docstring'''

								__lowercase			       = 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]
											)

								__lowercase			       = (result + self.b_coeffs[0] * sample) / self.a_coeffs[0]

								__lowercase			       = self.input_history[:-1]
								__lowercase			       = self.output_history[:-1]

								__lowercase			       = sample
								__lowercase			       = result

								return result


