
from __future__ import annotations

from collections.abc import Generator






def 						lowerCamelCase__							(      a   )   ->     Optional[Any]:







			if not isinstance(a	,	a   ) or n < 1:
						raise Exception('''Sequence only defined for positive integers'''   )

			yield n
			while n != 1:
						if n % 2 == 0:
									n //= 2
						else:
									_A:						int	    = 3 * n + 1
						yield n






def 						lowerCamelCase__							(      )   ->     Any:
			_A:						Tuple	    = 43
			_A:						Optional[int]	    = tuple(collatz_sequence(a   )   )
			print(a   )
			print(f"""Collatz sequence from {n} took {len(a   )} steps."""   )


if __name__ == "__main__":
			main()





UpperCAmelCase__	:  str      =   1000






def 						lowerCamelCase__							(      a   )   ->     float:
   return x * x






def 						lowerCamelCase__							(      a	,	a	,	a	,	a = 4   )   ->     float:
   assert callable(
       a   ), f"""the function(object) passed should be callable your input : {function}"""
   assert isinstance(a	,	(float, int)   ), f"""a should be float or integer your input : {a}"""
   assert isinstance(function(a   )	,	(float, int)   ), (
       "the function should return integer or float return type of your function, "
       f"""{type(a   )}"""
   )
   assert isinstance(a	,	(float, int)   ), f"""b should be float or integer your input : {b}"""
   assert (
       isinstance(a	,	a   ) 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

   _A:						int	    = (b - a) / N_STEPS
   _A:						Any	    = function(a   ) + function(a   )

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

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


if __name__ == "__main__":
   import doctest

   doctest.testmod()



