


import argparse

from transformers import ConvBertConfig, ConvBertModel, TFConvBertModel, load_tf_weights_in_convbert
from transformers.utils import logging


logging.set_verbosity_info()




def 			a_   (					SCREAMING_SNAKE_CASE__      :   int	,    SCREAMING_SNAKE_CASE__      :   Dict	,    SCREAMING_SNAKE_CASE__      :   Optional[Any]  ):
							'''simple docstring'''





							_lowerCamelCase :	Optional[Any]						=ConvBertConfig.from_json_file(lowerCamelCase__  )
							_lowerCamelCase :	str						=ConvBertModel(lowerCamelCase__  )

							_lowerCamelCase :	Optional[int]						=load_tf_weights_in_convbert(lowerCamelCase__	,    lowerCamelCase__	,    lowerCamelCase__  )
							model.save_pretrained(lowerCamelCase__  )

							_lowerCamelCase :	Optional[int]						=TFConvBertModel.from_pretrained(lowerCamelCase__	,    from_pt=lowerCamelCase__  )
							tf_model.save_pretrained(lowerCamelCase__  )


if __name__ == "__main__":
	lowerCamelCase		      = argparse.ArgumentParser()
	# Required parameters
	parser.add_argument(
	    '--tf_checkpoint_path', default=None, type=str, required=True, help='Path to the TensorFlow checkpoint path.'
	)
	parser.add_argument(
	    '--convbert_config_file',
	    default=None,
	    type=str,
	    required=True,
	    help=(
	        'The config json file corresponding to the pre-trained ConvBERT model. \n'
	        'This specifies the model architecture.'
	    ),
	)
	parser.add_argument(
	    '--pytorch_dump_path', default=None, type=str, required=True, help='Path to the output PyTorch model.'
	)
	lowerCamelCase		      = parser.parse_args()
	convert_orig_tfa_checkpoint_to_pytorch(args.tf_checkpoint_path, args.convbert_config_file, args.pytorch_dump_path)






from collections.abc import Callable

lowerCamelCase		      = Callable[[float], float]  # type alias for a real -> real function




def 			a_   (					SCREAMING_SNAKE_CASE__      :   RealFunc	,    SCREAMING_SNAKE_CASE__      :   RealFunc	,    SCREAMING_SNAKE_CASE__      :   int	,    ):
       '''simple docstring'''





       _lowerCamelCase :	Tuple						=float(SCREAMING_SNAKE_CASE__  )
       while True:
              try:
                     _lowerCamelCase :	int						=prev_guess - function(SCREAMING_SNAKE_CASE__  ) / derivative(SCREAMING_SNAKE_CASE__  )
              except ZeroDivisionError:
                     raise ZeroDivisionError('Could not find root'  ) from None
              if abs(prev_guess - next_guess  ) < 10**-5:
                     return next_guess
              _lowerCamelCase :	Union[str, Any]						=next_guess




def 			a_   (					SCREAMING_SNAKE_CASE__      :   float  ):
       '''simple docstring'''





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




def 			a_   (					SCREAMING_SNAKE_CASE__      :   float  ):
       '''simple docstring'''





       return 3 * (x**2) - 2


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


