code: 
  
  
  import argparse
  
  import torch
  from torch import nn
  
  from transformers import PLBartConfig, PLBartForConditionalGeneration, PLBartForSequenceClassification
  
  
  
  
  def   lowerCamelCase_       (					UpperCAmelCase__      ):
  
  
  
        """simple docstring"""
  
  
  
  
        a_					=		[
            """encoder.version""",
            """decoder.version""",
            """model.encoder.version""",
            """model.decoder.version""",
            """_float_tensor""",
            """decoder.output_projection.weight""",
        ]
        for k in ignore_keys:
              state_dict.pop(UpperCAmelCase__       ,    UpperCAmelCase__      )
  
  
  
  
  def   lowerCamelCase_       (					UpperCAmelCase__      ):
  
  
  
        """simple docstring"""
  
  
  
  
        a_			,   a_					=		emb.weight.shape
        a_					=		nn.Linear(UpperCAmelCase__       ,    UpperCAmelCase__       ,    bias=UpperCAmelCase__      )
        a_					=		emb.weight.data
        return lin_layer
  
  
  
  
  def   lowerCamelCase_       (					UpperCAmelCase__       ,    UpperCAmelCase__="uclanlp/plbart-base"       ,    UpperCAmelCase__=False       ,    UpperCAmelCase__=False      ):
  
  
  
        """simple docstring"""
  
  
  
  
        a_					=		torch.load(UpperCAmelCase__       ,    map_location="""cpu"""      )["""model"""]
        remove_ignore_keys_(UpperCAmelCase__      )
        a_					=		state_dict["""encoder.embed_tokens.weight"""].shape[0]
  
        a_					=		PLBartConfig.from_pretrained(UpperCAmelCase__       ,    vocab_size=UpperCAmelCase__      )
  
        a_					=		state_dict["""decoder.embed_tokens.weight"""]
        if not classification:
              a_					=		PLBartForConditionalGeneration(UpperCAmelCase__      )
              model.model.load_state_dict(UpperCAmelCase__      )
              if finetuned:
                    a_					=		make_linear_from_emb(model.model.shared      )
  
        else:
              a_					=		{}
              for key, value in state_dict.copy().items():
                    if key.startswith("""classification_heads.sentence_classification_head"""      ):
                          a_					=		value
                          state_dict.pop(UpperCAmelCase__      )
              a_					=		PLBartForSequenceClassification(UpperCAmelCase__      )
              model.model.load_state_dict(UpperCAmelCase__      )
              model.classification_head.load_state_dict(UpperCAmelCase__      )
  
        return model
  
  
  if __name__ == "__main__":
   A_    :					Optional[Any]             =argparse.ArgumentParser()
   # Required parameters
   parser.add_argument("""fairseq_path""", type=str, help="""model.pt on local filesystem.""")
   parser.add_argument("""pytorch_dump_folder_path""", default=None, type=str, help="""Path to the output PyTorch model.""")
   parser.add_argument(
       """--hf_config""",
       default="""uclanlp/plbart-base""",
       type=str,
       help="""Which huggingface architecture to use: plbart-base""",
   )
   parser.add_argument("""--finetuned""", action="""store_true""", help="""whether the model is a fine-tuned checkpoint""")
   parser.add_argument(
       """--classification""", action="""store_true""", help="""whether the model is a classification checkpoint"""
   )
   A_    :					Optional[Any]             =parser.parse_args()
   A_    :					Optional[Any]             =convert_fairseq_plbart_checkpoint_from_disk(
       args.fairseq_path,
       hf_config_path=args.hf_config,
       finetuned=args.finetuned,
       classification=args.classification,
   )
   model.save_pretrained(args.pytorch_dump_folder_path)
style_context: 
  
  
  from collections.abc import Callable
  
  A_    :					Any             =Callable[[float], float]  # type alias for a real -> real function
  
  
  
  
  def   lowerCamelCase_       (					UpperCAmelCase__       ,    UpperCAmelCase__       ,    UpperCAmelCase__       ,    ):
  
  
  
  						"""simple docstring"""
  
  
  
  
  						a_					=		float(UpperCAmelCase__      )
  						while True:
  												try:
  																		a_					=		prev_guess - function(UpperCAmelCase__      ) / derivative(UpperCAmelCase__      )
  												except ZeroDivisionError:
  																		raise ZeroDivisionError("""Could not find root"""      ) from None
  												if abs(prev_guess - next_guess      ) < 10**-5:
  																		return next_guess
  												a_					=		next_guess
  
  
  
  
  def   lowerCamelCase_       (					UpperCAmelCase__      ):
  
  
  
  						"""simple docstring"""
  
  
  
  
  						return (x**3) - (2 * x) - 5
  
  
  
  
  def   lowerCamelCase_       (					UpperCAmelCase__      ):
  
  
  
  						"""simple docstring"""
  
  
  
  
  						return 3 * (x**2) - 2
  
  
  if __name__ == "__main__":
  	print(newton(f, fa, 3))