code: 
  
  
  
  """simple docstring"""
  
  
  
  
  import argparse
  
  import torch
  from torch import nn
  
  from transformers import PLBartConfig, PLBartForConditionalGeneration, PLBartForSequenceClassification
  
  def 		__snake_case		(   SCREAMING_SNAKE_CASE__			:		int		)						->     Optional[Any]:
  
  
  
  
  
       '''simple docstring'''
  
       _UpperCAmelCase    :			List[Any]              =					[
           "encoder.version",
           "decoder.version",
           "model.encoder.version",
           "model.decoder.version",
           "_float_tensor",
           "decoder.output_projection.weight",
       ]
       for k in ignore_keys:
            state_dict.pop(SCREAMING_SNAKE_CASE__		,						SCREAMING_SNAKE_CASE__		)
  
  def 		__snake_case		(   SCREAMING_SNAKE_CASE__			:		Optional[Any]		)						->     Dict:
  
  
  
  
  
       '''simple docstring'''
  
       _UpperCAmelCase    :			Optional[int]              =					emb.weight.shape
       _UpperCAmelCase    :			Union[str, Any]              =					nn.Linear(SCREAMING_SNAKE_CASE__		,						SCREAMING_SNAKE_CASE__		,						bias=SCREAMING_SNAKE_CASE__		)
       _UpperCAmelCase    :			Union[str, Any]              =					emb.weight.data
       return lin_layer
  
  def 		__snake_case		(   SCREAMING_SNAKE_CASE__			:		List[Any]		,						SCREAMING_SNAKE_CASE__			:		str="uclanlp/plbart-base"		,						SCREAMING_SNAKE_CASE__			:		Dict=False		,						SCREAMING_SNAKE_CASE__			:		List[Any]=False		)						->     List[str]:
  
  
  
  
  
       '''simple docstring'''
  
       _UpperCAmelCase    :			Tuple              =					torch.load(SCREAMING_SNAKE_CASE__		,						map_location="cpu"		)["model"]
       remove_ignore_keys_(SCREAMING_SNAKE_CASE__		)
       _UpperCAmelCase    :			Optional[Any]              =					state_dict["encoder.embed_tokens.weight"].shape[0]
  
       _UpperCAmelCase    :			Any              =					PLBartConfig.from_pretrained(SCREAMING_SNAKE_CASE__		,						vocab_size=SCREAMING_SNAKE_CASE__		)
  
       _UpperCAmelCase    :			Optional[int]              =					state_dict["decoder.embed_tokens.weight"]
       if not classification:
            _UpperCAmelCase    :			Optional[int]              =					PLBartForConditionalGeneration(SCREAMING_SNAKE_CASE__		)
            model.model.load_state_dict(SCREAMING_SNAKE_CASE__		)
            if finetuned:
                 _UpperCAmelCase    :			Tuple              =					make_linear_from_emb(model.model.shared		)
  
       else:
            _UpperCAmelCase    :			Optional[int]              =					{}
            for key, value in state_dict.copy().items():
                 if key.startswith("classification_heads.sentence_classification_head"		):
                      _UpperCAmelCase    :			Union[str, Any]              =					value
                      state_dict.pop(SCREAMING_SNAKE_CASE__		)
            _UpperCAmelCase    :			Any              =					PLBartForSequenceClassification(SCREAMING_SNAKE_CASE__		)
            model.model.load_state_dict(SCREAMING_SNAKE_CASE__		)
            model.classification_head.load_state_dict(SCREAMING_SNAKE_CASE__		)
  
       return model
  
  
  if __name__ == "__main__":
   _lowerCAmelCase       :      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"
   )
   _lowerCAmelCase       :      List[str]							=							parser.parse_args()
   _lowerCAmelCase       :      Union[str, 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: 
  
  
  
  """simple docstring"""
  
  
  
  
  import sys
  
  def 		__snake_case		(   SCREAMING_SNAKE_CASE__			:		int		,						SCREAMING_SNAKE_CASE__			:		list[int]       )						->     int:
  
  
  
  
  
       '''simple docstring'''
  
       if not numbers:
            return 0
       if target == 0 and target in numbers:
            return 0
       if not isinstance(SCREAMING_SNAKE_CASE__		,						(list, tuple)       ) or not all(
           isinstance(SCREAMING_SNAKE_CASE__		,						SCREAMING_SNAKE_CASE__       ) for number in numbers       ):
            raise ValueError("numbers must be an iterable of integers"       )
  
       _UpperCAmelCase    :			List[Any]              =					0
       _UpperCAmelCase    :			str              =					sys.maxsize
  
       while right < len(SCREAMING_SNAKE_CASE__       ):
            curr_sum += numbers[right]
            while curr_sum >= target and left <= right:
                 _UpperCAmelCase    :			Any              =					min(SCREAMING_SNAKE_CASE__		,						right - left + 1       )
                 curr_sum -= numbers[left]
                 left += 1
            right += 1
  
       return 0 if min_len == sys.maxsize else min_len
  