



from math import cos, sin, sqrt, tau

from audio_filters.iir_filter import IIRFilter






def        A       (      _lowerCamelCase       ,				_lowerCamelCase       ,				_lowerCamelCase = 1 / sqrt(2						)						):





							'''simple docstring'''




							_lowerCAmelCase  :							Dict				     =					tau * frequency / samplerate
							_lowerCAmelCase  :							str				     =					sin(__UpperCamelCase						)
							_lowerCAmelCase  :							List[Any]				     =					cos(__UpperCamelCase						)
							_lowerCAmelCase  :							int				     =					_sin / (2 * q_factor)

							_lowerCAmelCase  :							Optional[int]				     =					(1 - _cos) / 2
							_lowerCAmelCase  :							Union[str, Any]				     =					1 - _cos

							_lowerCAmelCase  :							str				     =					1 + alpha
							_lowerCAmelCase  :							List[Any]				     =					-2 * _cos
							_lowerCAmelCase  :							Tuple				     =					1 - alpha

							_lowerCAmelCase  :							Optional[int]				     =					IIRFilter(2						)
							filt.set_coefficients([aa, aa, aa]       ,				[ba, ba, ba]						)
							return filt






def        A       (      _lowerCamelCase       ,				_lowerCamelCase       ,				_lowerCamelCase = 1 / sqrt(2						)						):





							'''simple docstring'''




							_lowerCAmelCase  :							str				     =					tau * frequency / samplerate
							_lowerCAmelCase  :							Union[str, Any]				     =					sin(__UpperCamelCase						)
							_lowerCAmelCase  :							Tuple				     =					cos(__UpperCamelCase						)
							_lowerCAmelCase  :							List[Any]				     =					_sin / (2 * q_factor)

							_lowerCAmelCase  :							Any				     =					(1 + _cos) / 2
							_lowerCAmelCase  :							List[str]				     =					-1 - _cos

							_lowerCAmelCase  :							Tuple				     =					1 + alpha
							_lowerCAmelCase  :							str				     =					-2 * _cos
							_lowerCAmelCase  :							Any				     =					1 - alpha

							_lowerCAmelCase  :							Tuple				     =					IIRFilter(2						)
							filt.set_coefficients([aa, aa, aa]       ,				[ba, ba, ba]						)
							return filt






def        A       (      _lowerCamelCase       ,				_lowerCamelCase       ,				_lowerCamelCase = 1 / sqrt(2						)						):





							'''simple docstring'''




							_lowerCAmelCase  :							Dict				     =					tau * frequency / samplerate
							_lowerCAmelCase  :							Dict				     =					sin(__UpperCamelCase						)
							_lowerCAmelCase  :							Optional[int]				     =					cos(__UpperCamelCase						)
							_lowerCAmelCase  :							Optional[int]				     =					_sin / (2 * q_factor)

							_lowerCAmelCase  :							Dict				     =					_sin / 2
							_lowerCAmelCase  :							int				     =					0
							_lowerCAmelCase  :							Tuple				     =					-ba

							_lowerCAmelCase  :							Optional[int]				     =					1 + alpha
							_lowerCAmelCase  :							List[str]				     =					-2 * _cos
							_lowerCAmelCase  :							Tuple				     =					1 - alpha

							_lowerCAmelCase  :							Union[str, Any]				     =					IIRFilter(2						)
							filt.set_coefficients([aa, aa, aa]       ,				[ba, ba, ba]						)
							return filt






def        A       (      _lowerCamelCase       ,				_lowerCamelCase       ,				_lowerCamelCase = 1 / sqrt(2						)						):





							'''simple docstring'''




							_lowerCAmelCase  :							Any				     =					tau * frequency / samplerate
							_lowerCAmelCase  :							List[Any]				     =					sin(__UpperCamelCase						)
							_lowerCAmelCase  :							Union[str, Any]				     =					cos(__UpperCamelCase						)
							_lowerCAmelCase  :							Optional[int]				     =					_sin / (2 * q_factor)

							_lowerCAmelCase  :							Tuple				     =					1 - alpha
							_lowerCAmelCase  :							Union[str, Any]				     =					-2 * _cos
							_lowerCAmelCase  :							Union[str, Any]				     =					1 + alpha

							_lowerCAmelCase  :							int				     =					IIRFilter(2						)
							filt.set_coefficients([ba, ba, ba]       ,				[ba, ba, ba]						)
							return filt






def        A       (      _lowerCamelCase       ,				_lowerCamelCase       ,				_lowerCamelCase       ,				_lowerCamelCase = 1 / sqrt(2						)       ,				):





							'''simple docstring'''




							_lowerCAmelCase  :							int				     =					tau * frequency / samplerate
							_lowerCAmelCase  :							Optional[Any]				     =					sin(__UpperCamelCase						)
							_lowerCAmelCase  :							Tuple				     =					cos(__UpperCamelCase						)
							_lowerCAmelCase  :							Optional[Any]				     =					_sin / (2 * q_factor)
							_lowerCAmelCase  :							Tuple				     =					10 ** (gain_db / 40)

							_lowerCAmelCase  :							Union[str, Any]				     =					1 + alpha * big_a
							_lowerCAmelCase  :							List[str]				     =					-2 * _cos
							_lowerCAmelCase  :							str				     =					1 - alpha * big_a
							_lowerCAmelCase  :							List[str]				     =					1 + alpha / big_a
							_lowerCAmelCase  :							str				     =					-2 * _cos
							_lowerCAmelCase  :							Optional[int]				     =					1 - alpha / big_a

							_lowerCAmelCase  :							Tuple				     =					IIRFilter(2						)
							filt.set_coefficients([aa, aa, aa]       ,				[ba, ba, ba]						)
							return filt






def        A       (      _lowerCamelCase       ,				_lowerCamelCase       ,				_lowerCamelCase       ,				_lowerCamelCase = 1 / sqrt(2						)       ,				):





							'''simple docstring'''




							_lowerCAmelCase  :							List[Any]				     =					tau * frequency / samplerate
							_lowerCAmelCase  :							Any				     =					sin(__UpperCamelCase						)
							_lowerCAmelCase  :							Tuple				     =					cos(__UpperCamelCase						)
							_lowerCAmelCase  :							int				     =					_sin / (2 * q_factor)
							_lowerCAmelCase  :							str				     =					10 ** (gain_db / 40)
							_lowerCAmelCase  :							Optional[Any]				     =					(big_a + 1) - (big_a - 1) * _cos
							_lowerCAmelCase  :							int				     =					(big_a + 1) + (big_a - 1) * _cos
							_lowerCAmelCase  :							str				     =					(big_a - 1) - (big_a + 1) * _cos
							_lowerCAmelCase  :							Any				     =					(big_a - 1) + (big_a + 1) * _cos
							_lowerCAmelCase  :							Dict				     =					2 * sqrt(__UpperCamelCase						) * alpha

							_lowerCAmelCase  :							Optional[int]				     =					big_a * (pmc + aaa)
							_lowerCAmelCase  :							int				     =					2 * big_a * mpc
							_lowerCAmelCase  :							List[Any]				     =					big_a * (pmc - aaa)
							_lowerCAmelCase  :							str				     =					ppmc + aaa
							_lowerCAmelCase  :							Tuple				     =					-2 * pmpc
							_lowerCAmelCase  :							Any				     =					ppmc - aaa

							_lowerCAmelCase  :							List[str]				     =					IIRFilter(2						)
							filt.set_coefficients([aa, aa, aa]       ,				[ba, ba, ba]						)
							return filt






def        A       (      _lowerCamelCase       ,				_lowerCamelCase       ,				_lowerCamelCase       ,				_lowerCamelCase = 1 / sqrt(2						)       ,				):





							'''simple docstring'''




							_lowerCAmelCase  :							Any				     =					tau * frequency / samplerate
							_lowerCAmelCase  :							List[str]				     =					sin(__UpperCamelCase						)
							_lowerCAmelCase  :							Optional[int]				     =					cos(__UpperCamelCase						)
							_lowerCAmelCase  :							Tuple				     =					_sin / (2 * q_factor)
							_lowerCAmelCase  :							Union[str, Any]				     =					10 ** (gain_db / 40)
							_lowerCAmelCase  :							int				     =					(big_a + 1) - (big_a - 1) * _cos
							_lowerCAmelCase  :							str				     =					(big_a + 1) + (big_a - 1) * _cos
							_lowerCAmelCase  :							Optional[int]				     =					(big_a - 1) - (big_a + 1) * _cos
							_lowerCAmelCase  :							List[Any]				     =					(big_a - 1) + (big_a + 1) * _cos
							_lowerCAmelCase  :							str				     =					2 * sqrt(__UpperCamelCase						) * alpha

							_lowerCAmelCase  :							Tuple				     =					big_a * (ppmc + aaa)
							_lowerCAmelCase  :							List[Any]				     =					-2 * big_a * pmpc
							_lowerCAmelCase  :							Optional[Any]				     =					big_a * (ppmc - aaa)
							_lowerCAmelCase  :							int				     =					pmc + aaa
							_lowerCAmelCase  :							Any				     =					2 * mpc
							_lowerCAmelCase  :							Dict				     =					pmc - aaa

							_lowerCAmelCase  :							str				     =					IIRFilter(2						)
							filt.set_coefficients([aa, aa, aa]       ,				[ba, ba, ba]						)
							return filt





def        A       (      _lowerCamelCase						):





							'''simple docstring'''




							_lowerCAmelCase  :							int				     =					len(_lowerCamelCase						)
							for i in range(1       ,				_lowerCamelCase						):
														_lowerCAmelCase  :							List[Any]				     =					collection[i]
														_lowerCAmelCase  :							str				     =					0
														_lowerCAmelCase  :							Union[str, Any]				     =					i - 1

														while low <= high:
																					_lowerCAmelCase  :							List[str]				     =					(low + high) // 2
																					if val < collection[mid]:
																												_lowerCAmelCase  :							Optional[int]				     =					mid - 1
																					else:
																												_lowerCAmelCase  :							List[str]				     =					mid + 1
														for j in range(_lowerCamelCase       ,				_lowerCamelCase       ,				-1						):
																					_lowerCAmelCase  :							int				     =					collection[j - 1]
														_lowerCAmelCase  :							Optional[int]				     =					val
							return collection


if __name__ == "__main__":
						_snake_case	=						input("Enter numbers separated by a comma:\n").strip()
						_snake_case	=						[int(item) for item in user_input.split(",")]
						print(binary_insertion_sort(unsorted))
