

class 					lowercase							:




				def __init__(   self			):
											snake_case_     							=       ''
											snake_case_     							=       ''
											snake_case_     							=       []




				def        a				(   self ,  snake_case ,  snake_case			):
											if m == -1:
																		return n + 1
											elif n == -1:
																		return m + 1
											elif self.dp[m][n] > -1:
																		return self.dp[m][n]
											else:
																		if self.worda[m] == self.worda[n]:
																									snake_case_     							=       self.__min_dist_top_down_dp(m - 1 ,  n - 1			)
																		else:
																									snake_case_     							=       self.__min_dist_top_down_dp(snake_case ,  n - 1			)
																									snake_case_     							=       self.__min_dist_top_down_dp(m - 1 ,  snake_case			)
																									snake_case_     							=       self.__min_dist_top_down_dp(m - 1 ,  n - 1			)
																									snake_case_     							=       1 + min(snake_case ,  snake_case ,  snake_case			)

																		return self.dp[m][n]




				def        a				(   self ,  snake_case ,  snake_case			):
											snake_case_     							=       worda
											snake_case_     							=       worda
											snake_case_     							=       [[-1 for _ in range(len(snake_case			)			)] for _ in range(len(snake_case			)			)]

											return self.__min_dist_top_down_dp(len(snake_case			) - 1 ,  len(snake_case			) - 1			)




				def        a				(   self ,  snake_case ,  snake_case			):
											snake_case_     							=       worda
											snake_case_     							=       worda
											snake_case_     							=       len(snake_case			)
											snake_case_     							=       len(snake_case			)
											snake_case_     							=       [[0 for _ in range(n + 1			)] for _ in range(m + 1			)]

											for i in range(m + 1			):
																		for j in range(n + 1			):
																									if i == 0:  # first string is empty
																																snake_case_     							=       j
																									elif j == 0:  # second string is empty
																																snake_case_     							=       i
																									elif worda[i - 1] == worda[j - 1]:  # last characters are equal
																																snake_case_     							=       self.dp[i - 1][j - 1]
																									else:
																																snake_case_     							=       self.dp[i][j - 1]
																																snake_case_     							=       self.dp[i - 1][j]
																																snake_case_     							=       self.dp[i - 1][j - 1]
																																snake_case_     							=       1 + min(snake_case ,  snake_case ,  snake_case			)
											return self.dp[m][n]


if __name__ == "__main__":
					_UpperCAmelCase						:  List[Any]									=			EditDistance()

					print("""****************** Testing Edit Distance DP Algorithm ******************""")
					print()

					_UpperCAmelCase						:  Optional[Any]									=			input("""Enter the first string: """).strip()
					_UpperCAmelCase						:  Tuple									=			input("""Enter the second string: """).strip()

					print()
					print(F'''The minimum edit distance is: {solver.min_dist_top_down(Sa, Sa)}''')
					print(F'''The minimum edit distance is: {solver.min_dist_bottom_up(Sa, Sa)}''')
					print()
					print("""*************** End of Testing Edit Distance DP Algorithm ***************""")







import argparse

import torch

from transformers import BertConfig, BertForPreTraining, load_tf_weights_in_bert
from transformers.utils import logging


logging.set_verbosity_info()





def    __lowerCamelCase      (					UpperCamelCase__  ,				UpperCamelCase__  ,				UpperCamelCase__ ):







							'''simple docstring'''






							snake_case_     							=       BertConfig.from_json_file(UpperCamelCase__ )
							print(F'''Building PyTorch model from configuration: {config}''' )
							snake_case_     							=       BertForPreTraining(UpperCamelCase__ )

							# Load weights from tf checkpoint
							load_tf_weights_in_bert(UpperCamelCase__  ,				UpperCamelCase__  ,				UpperCamelCase__ )

							# Save pytorch-model
							print(F'''Save PyTorch model to {pytorch_dump_path}''' )
							torch.save(model.state_dict()  ,				UpperCamelCase__ )


if __name__ == "__main__":
					_UpperCAmelCase						:  Union[str, Any]									=			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(
					    """--bert_config_file""",
					    default=None,
					    type=str,
					    required=True,
					    help=(
					        """The config json file corresponding to the pre-trained BERT 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."""
					)
					_UpperCAmelCase						:  Any									=			parser.parse_args()
					convert_tf_checkpoint_to_pytorch(args.tf_checkpoint_path, args.bert_config_file, args.pytorch_dump_path)




