'''simple docstring'''

from collections.abc import Callable

_A      :				Tuple 				=    Callable[[float], float]  # type alias for a real -> real function







def 					UpperCamelCase_						( snake_case_	:	RealFunc						,		snake_case_	:	RealFunc						,		snake_case_	:	int						,		) ->					float:






 '''simple docstring'''

 __lowerCAmelCase    							=						float(snake_case_				)
 while True:
  try:
   __lowerCAmelCase    							=						prev_guess - function(snake_case_				) / derivative(snake_case_				)
  except ZeroDivisionError:
   raise ZeroDivisionError("""Could not find root"""				) from None
  if abs(prev_guess - next_guess				) < 10**-5:
   return next_guess
  __lowerCAmelCase    							=						next_guess







def 					UpperCamelCase_						( snake_case_	:	float				) ->					float:






 '''simple docstring'''

 return (x**3) - (2 * x) - 5







def 					UpperCamelCase_						( snake_case_	:	float				) ->					float:






 '''simple docstring'''

 return 3 * (x**2) - 2


if __name__ == "__main__":
 print(newton(f, fa, 3))







'''simple docstring'''

from unittest.mock import patch

import datasets
from datasets import Dataset







def 					UpperCamelCase_						( ) ->					Dict:






 '''simple docstring'''

 __lowerCAmelCase    							=						Dataset.from_dict({"""col_1""": [3, 2, 0, 1]}				)

 with patch("""tqdm.auto.tqdm"""				) as mock_tqdm:
  datasets.disable_progress_bar()
  dset.map(lambda snake_case_				: {"col_2": x["col_1"] + 1}				)
  mock_tqdm.assert_not_called()

  mock_tqdm.reset_mock()

  datasets.enable_progress_bar()
  dset.map(lambda snake_case_				: {"col_2": x["col_1"] + 1}				)
  mock_tqdm.assert_called()






