





from ..utils import DummyObject, requires_backends




class 				_a		(   metaclass=_lowerCAmelCase       ):
				UpperCamelCase			=					['''torch''', '''librosa''']






				def __init__(				self	:					Optional[int],				*lowerCAmelCase__	:					str,				**lowerCAmelCase__	:					Dict							)			->   Tuple:




										'''simple docstring'''



										requires_backends(self,				['''torch''', '''librosa''']							)






				@classmethod
				def        snake_case			(				cls	:					Tuple,				*lowerCAmelCase__	:					str,				**lowerCAmelCase__	:					Optional[Any]							)			->   Optional[int]:




										'''simple docstring'''



										requires_backends(cls,				['''torch''', '''librosa''']							)






				@classmethod
				def        snake_case			(				cls	:					Tuple,				*lowerCAmelCase__	:					List[Any],				**lowerCAmelCase__	:					List[Any]							)			->   Optional[int]:




										'''simple docstring'''



										requires_backends(cls,				['''torch''', '''librosa''']							)




class 				_a		(   metaclass=_lowerCAmelCase       ):
				UpperCamelCase			=					['''torch''', '''librosa''']






				def __init__(				self	:					Optional[int],				*lowerCAmelCase__	:					Optional[Any],				**lowerCAmelCase__	:					Optional[int]							)			->   Dict:




										'''simple docstring'''



										requires_backends(self,				['''torch''', '''librosa''']							)






				@classmethod
				def        snake_case			(				cls	:					int,				*lowerCAmelCase__	:					Optional[Any],				**lowerCAmelCase__	:					Optional[int]							)			->   Union[str, Any]:




										'''simple docstring'''



										requires_backends(cls,				['''torch''', '''librosa''']							)






				@classmethod
				def        snake_case			(				cls	:					Union[str, Any],				*lowerCAmelCase__	:					Optional[int],				**lowerCAmelCase__	:					List[Any]							)			->   List[Any]:




										'''simple docstring'''



										requires_backends(cls,				['''torch''', '''librosa''']							)










"""simple docstring"""




UpperCamelCase_     =1_000





def  a_       (							_lowercase     ):
						return x * x





def  a_       (							_lowercase ,		_lowercase ,		_lowercase ,		_lowercase = 4     ):
						assert callable(
						    _lowercase     ), F"""the function(object) passed should be callable your input : {function}"""
						assert isinstance(_lowercase ,		(float, int)     ), F"""a should be float or integer your input : {a}"""
						assert isinstance(function(_lowercase     ) ,		(float, int)     ), (
						    "the function should return integer or float return type of your function, "
						    F"""{type(_lowercase     )}"""
						)
						assert isinstance(_lowercase ,		(float, int)     ), F"""b should be float or integer your input : {b}"""
						assert (
						    isinstance(_lowercase ,		_lowercase     ) and precision > 0
						), F"""precision should be positive integer your input : {precision}"""

						# just applying the formula of simpson for approximate integration written in
						# mentioned article in first comment of this file and above this function

						_UpperCamelCase    :      str						     =					(b - a) / N_STEPS
						_UpperCamelCase    :      Dict						     =					function(_lowercase     ) + function(_lowercase     )

						for i in range(1 ,		_lowercase     ):
												_UpperCamelCase    :      List[Any]						     =					a + h * i
												result += function(_lowercase     ) * (4 if i % 2 else 2)

						result *= h / 3
						return round(_lowercase ,		_lowercase     )


if __name__ == "__main__":
						import doctest

						doctest.testmod()



