





"""simple docstring"""
def 			__snake_case						(      __A ,__A    )		->				int:
   # "Simpson Rule"
   # int(f) = delta_x/2 * (b-a)/3*(f1 + 4f2 + 2f_3 + ... + fn)
   lowercase    :			str  =       (boundary[1] - boundary[0]) / steps
   lowercase    :			List[str]  =       boundary[0]
   lowercase    :			Optional[Any]  =       boundary[1]
   lowercase    :			List[Any]  =       make_points(__A ,__A ,__A    )
   lowercase    :			Any  =       0.0
   y += (h / 3.0) * f(__A    )
   lowercase    :			Union[str, Any]  =       2
   for i in x_i:
      y += (h / 3) * (4 - 2 * (cnt % 2)) * f(__A    )
      cnt += 1
   y += (h / 3.0) * f(__A    )
   return y




def 			__snake_case						(      __A ,__A ,__A    )		->				int:
   lowercase    :			Union[str, Any]  =       a + h
   while x < (b - h):
      yield x
      lowercase    :			Optional[int]  =       x + h




def 			__snake_case						(      __A    )		->				int:  # enter your function here
   lowercase    :			int  =       (x - 0) * (x - 0)
   return y




def 			__snake_case						(      )		->				Optional[int]:
   lowercase    :			str  =       0.0  # Lower bound of integration
   lowercase    :			Any  =       1.0  # Upper bound of integration
   lowercase    :			Dict  =       10.0  # define number of steps or resolution
   lowercase    :			Any  =       [a, b]  # define boundary of integration
   lowercase    :			List[str]  =       method_a(__A ,__A    )
   print(F'''y = {y}'''    )


if __name__ == "__main__":
   main()









"""simple docstring"""
import argparse

from . import (
    BertConfig,
    BertGenerationConfig,
    BertGenerationDecoder,
    BertGenerationEncoder,
    load_tf_weights_in_bert_generation,
    logging,
)


logging.set_verbosity_info()




def 			__snake_case						(      __A ,__A ,__A ,__A ,__A    )		->				Optional[int]:
   # Initialise PyTorch model
   lowercase    :			Optional[Any]  =       BertConfig.from_pretrained(
       """bert-large-cased""" ,vocab_size=__A ,max_position_embeddings=512 ,is_decoder=__A ,add_cross_attention=__A ,)
   lowercase    :			List[str]  =       bert_config.to_dict()
   del bert_config_dict["type_vocab_size"]
   lowercase    :			Tuple  =       BertGenerationConfig(**__A    )
   if is_encoder:
      lowercase    :			Dict  =       BertGenerationEncoder(__A    )
   else:
      lowercase    :			Dict  =       BertGenerationDecoder(__A    )
   print(F'''Building PyTorch model from configuration: {config}'''    )

   # Load weights from tf checkpoint
   load_tf_weights_in_bert_generation(
       __A ,__A ,model_class="""bert""" ,is_encoder_named_decoder=__A ,is_encoder=__A ,)

   # Save pytorch-model
   print(F'''Save PyTorch model and config to {pytorch_dump_path}'''    )
   model.save_pretrained(__A    )


if __name__ == "__main__":
   lowerCAmelCase:	Dict							      =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:	Optional[int]							      =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,
   )


