"""simple docstring"""




from dataclasses import dataclass
from typing import Optional, Tuple

import torch
from torch import nn
from transformers import RobertaPreTrainedModel, XLMRobertaConfig, XLMRobertaModel
from transformers.utils import ModelOutput
@dataclass
class 		__A							(				SCREAMING_SNAKE_CASE_	):
     _UpperCamelCase							:    Optional[torch.FloatTensor]	      =	None
     _UpperCamelCase							:    torch.FloatTensor	      =	None
     _UpperCamelCase							:    Optional[Tuple[torch.FloatTensor]]	      =	None
     _UpperCamelCase							:    Optional[Tuple[torch.FloatTensor]]	      =	None







class 		__A							(				SCREAMING_SNAKE_CASE_	):






     def __init__(	self       ,  a__=1       ,  a__=0       ,  a__=2       ,  a__=512       ,  a__="cls"       ,  a__=False       ,  a__=True       ,  **a__       ,  ):
       super().__init__(pad_token_id=a__       ,  bos_token_id=a__       ,  eos_token_id=a__       ,  **a__						)
       _lowerCAmelCase		: Union[str, Any]						    =  project_dim
       _lowerCAmelCase		: Optional[int]						    =  pooler_fn
       _lowerCAmelCase		: Any						    =  learn_encoder
       _lowerCAmelCase		: Union[str, Any]						    =  use_attention_mask







class 		__A							(				SCREAMING_SNAKE_CASE_	):
     _UpperCamelCase							:    List[Any]	      =	[R"pooler", R"logit_scale"]
     _UpperCamelCase							:    int	      =	[R"position_ids", R"predictions.decoder.bias"]
     _UpperCamelCase							:    Dict	      =	"roberta"
     _UpperCamelCase							:    Tuple	      =	RobertaSeriesConfig






     def __init__(	self       ,  a__						):
       super().__init__(a__						)
       _lowerCAmelCase		: Any						    =  XLMRobertaModel(a__						)
       _lowerCAmelCase		: Union[str, Any]						    =  nn.Linear(config.hidden_size       ,  config.project_dim						)
       _lowerCAmelCase		: List[Any]						    =  getattr(a__       ,  """has_pre_transformation"""       ,  a__						)
       if self.has_pre_transformation:
         _lowerCAmelCase		: List[Any]						    =  nn.Linear(config.hidden_size       ,  config.project_dim						)
         _lowerCAmelCase		: Tuple						    =  nn.LayerNorm(config.hidden_size       ,  eps=config.layer_norm_eps						)
       self.post_init()






     def 					__A						(	self       ,  a__ = None       ,  a__ = None       ,  a__ = None       ,  a__ = None       ,  a__ = None       ,  a__ = None       ,  a__ = None       ,  a__ = None       ,  a__ = None       ,  a__ = None       ,  a__ = None       ,  ):
       _lowerCAmelCase		: Optional[int]						    =  return_dict if return_dict is not None else self.config.use_return_dict

       _lowerCAmelCase		: Any						    =  self.base_model(
           input_ids=a__       ,  attention_mask=a__       ,  token_type_ids=a__       ,  position_ids=a__       ,  head_mask=a__       ,  inputs_embeds=a__       ,  encoder_hidden_states=a__       ,  encoder_attention_mask=a__       ,  output_attentions=a__       ,  output_hidden_states=True if self.has_pre_transformation else output_hidden_states       ,  return_dict=a__       ,  )

       if self.has_pre_transformation:
         _lowerCAmelCase		: List[str]						    =  outputs["""hidden_states"""][-2]
         _lowerCAmelCase		: Tuple						    =  self.pre_LN(a__						)
         _lowerCAmelCase		: List[Any]						    =  self.transformation_pre(a__						)

         return TransformationModelOutput(
             projection_state=a__       ,  last_hidden_state=outputs.last_hidden_state       ,  hidden_states=outputs.hidden_states       ,  attentions=outputs.attentions       ,  )
       else:
         _lowerCAmelCase		: Dict						    =  self.transformation(outputs.last_hidden_state						)
         return TransformationModelOutput(
             projection_state=a__       ,  last_hidden_state=outputs.last_hidden_state       ,  hidden_states=outputs.hidden_states       ,  attentions=outputs.attentions       ,  )





"""simple docstring"""




def 							SCREAMING_SNAKE_CASE  (    _lowerCamelCase		: int			) ->   bool:
  return sum(i for i in range(1    ,number // 2 + 1			) if number % i == 0			) == number


if __name__ == "__main__":
     print('Program to check whether a number is a Perfect number or not...')
     _a   :	int 					=     int(input('Enter number: ').strip())
     print(F"""{number} is {"" if perfect(number) else "not "}a Perfect Number.""")




