code: 
  
  
  import argparse
  
  from . import (
      BertConfig,
      BertGenerationConfig,
      BertGenerationDecoder,
      BertGenerationEncoder,
      load_tf_weights_in_bert_generation,
      logging,
  )
  
  
  logging.set_verbosity_info()
  
  
  
  def   SCREAMING_SNAKE_CASE__						(							snake_case_,	snake_case_,	snake_case_,	snake_case_,	snake_case_	)			->							List[Any]:
  				# Initialise PyTorch model
  				A__     :							Any   				=BertConfig.from_pretrained(
  				    '''bert-large-cased''',	vocab_size=snake_case_,	max_position_embeddings=5_1_2,	is_decoder=snake_case_,	add_cross_attention=snake_case_,	)
  				A__     :							Union[str, Any]   				=bert_config.to_dict()
  				del bert_config_dict["type_vocab_size"]
  				A__     :							Any   				=BertGenerationConfig(**snake_case_	)
  				if is_encoder:
  								A__     :							List[Any]   				=BertGenerationEncoder(snake_case_	)
  				else:
  								A__     :							Union[str, Any]   				=BertGenerationDecoder(snake_case_	)
  				print(f'Building PyTorch model from configuration: {config}'	)
  
  				# Load weights from tf checkpoint
  				load_tf_weights_in_bert_generation(
  				    snake_case_,	snake_case_,	model_class='''bert''',	is_encoder_named_decoder=snake_case_,	is_encoder=snake_case_,	)
  
  				# Save pytorch-model
  				print(f'Save PyTorch model and config to {pytorch_dump_path}'	)
  				model.save_pretrained(snake_case_	)
  
  
  if __name__ == "__main__":
  						__lowerCamelCase       :       Optional[int]				   =			argparse.ArgumentParser()
  						# Required parameters
  						parser.add_argument(
  						    "--tf_hub_path", default=None, type=str, required=True, help="Path to the TensorFlow checkpoint path."
  						)
  						parser.add_argument(
  						    "--pytorch_dump_path", default=None, type=str, required=True, help="Path to the output PyTorch model."
  						)
  						parser.add_argument(
  						    "--is_encoder_named_decoder",
  						    action="store_true",
  						    help="If decoder has to be renamed to encoder in PyTorch model.",
  						)
  						parser.add_argument("--is_encoder", action="store_true", help="If model is an encoder.")
  						parser.add_argument("--vocab_size", default=50358, type=int, help="Vocab size of model")
  						__lowerCamelCase       :       str				   =			parser.parse_args()
  						convert_tf_checkpoint_to_pytorch(
  						    args.tf_hub_path,
  						    args.pytorch_dump_path,
  						    args.is_encoder_named_decoder,
  						    args.vocab_size,
  						    is_encoder=args.is_encoder,
  						)
  
  
  
  
style_context: 
  
  
  def   SCREAMING_SNAKE_CASE__						(							snake_case_	)			->							int:
  				if number != int(snake_case_	):
  								raise ValueError('''factorial() only accepts integral values'''	)
  				if number < 0:
  								raise ValueError('''factorial() not defined for negative values'''	)
  				A__     :							Union[str, Any]   				=1
  				for i in range(1,	number + 1	):
  								value *= i
  				return value
  
  
  
  def   SCREAMING_SNAKE_CASE__						(							snake_case_	)			->							int:
  				if not isinstance(snake_case_,	snake_case_	):
  								raise ValueError('''factorial() only accepts integral values'''	)
  				if n < 0:
  								raise ValueError('''factorial() not defined for negative values'''	)
  				return 1 if n == 0 or n == 1 else n * factorial(n - 1	)
  
  
  if __name__ == "__main__":
  						import doctest
  
  						doctest.testmod()
  
  						__lowerCamelCase       :       Any				   =			int(input("Enter a positive integer: ").strip() or 0)
  						print(F"factorial{n} is {factorial(n)}")
  
  
  
  