"""simple docstring"""






from collections import OrderedDict
from typing import Any, List, Mapping, Optional

from ... import PreTrainedTokenizer, TensorType, is_torch_available
from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfigWithPast, PatchingSpec
from ...utils import logging


__A			   = logging.get_logger(__name__)

__A			   = {
    "EleutherAI/gpt-j-6B": "https://huggingface.co/EleutherAI/gpt-j-6B/resolve/main/config.json",
    # See all GPT-J models at https://huggingface.co/models?filter=gpt_j
}


class     UpperCAmelCase						(_UpperCAmelCase  ):



    """simple docstring"""

    _UpperCAmelCase	:Dict						    = "gptj"
    _UpperCAmelCase	:List[Any]						    = {
        "max_position_embeddings": "n_positions",
        "hidden_size": "n_embd",
        "num_attention_heads": "n_head",
        "num_hidden_layers": "n_layer",
    }






    def __init__(   self    ,			_UpperCAmelCase=50400    ,			_UpperCAmelCase=2048    ,			_UpperCAmelCase=4096    ,			_UpperCAmelCase=28    ,			_UpperCAmelCase=16    ,			_UpperCAmelCase=64    ,			_UpperCAmelCase=None    ,			_UpperCAmelCase="gelu_new"    ,			_UpperCAmelCase=0.0    ,			_UpperCAmelCase=0.0    ,			_UpperCAmelCase=0.0    ,			_UpperCAmelCase=1e-5    ,			_UpperCAmelCase=0.02    ,			_UpperCAmelCase=True    ,			_UpperCAmelCase=50256    ,			_UpperCAmelCase=50256    ,			_UpperCAmelCase=False    ,			**_UpperCAmelCase    ,			):
       lowercase__:   Optional[int]					=      vocab_size
       lowercase__:   int					=      n_positions
       lowercase__:   Optional[Any]					=      n_embd
       lowercase__:   Dict					=      n_layer
       lowercase__:   str					=      n_head
       lowercase__:   int					=      n_inner
       lowercase__:   Tuple					=      rotary_dim
       lowercase__:   Any					=      activation_function
       lowercase__:   Optional[Any]					=      resid_pdrop
       lowercase__:   str					=      embd_pdrop
       lowercase__:   Union[str, Any]					=      attn_pdrop
       lowercase__:   str					=      layer_norm_epsilon
       lowercase__:   str					=      initializer_range
       lowercase__:   str					=      use_cache

       lowercase__:   Optional[int]					=      bos_token_id
       lowercase__:   str					=      eos_token_id

       super().__init__(
           bos_token_id=_UpperCAmelCase    ,			eos_token_id=_UpperCAmelCase    ,			tie_word_embeddings=_UpperCAmelCase    ,			**_UpperCAmelCase							)



class     UpperCAmelCase						(_UpperCAmelCase  ):



    """simple docstring"""

    def __init__(   self    ,			_UpperCAmelCase    ,			_UpperCAmelCase = "default"    ,			_UpperCAmelCase = None    ,			_UpperCAmelCase = False    ,			):
       super().__init__(_UpperCAmelCase    ,			task=_UpperCAmelCase    ,			patching_specs=_UpperCAmelCase    ,			use_past=_UpperCAmelCase							)
       if not getattr(self._config    ,			'''pad_token_id'''    ,			_UpperCAmelCase							):
          # TODO: how to do that better?
          lowercase__:   Any					=      0






    @property
    def _snake_case			(   self							):
       lowercase__:   int					=      OrderedDict({'''input_ids''': {0: '''batch''', 1: '''sequence'''}}							)
       if self.use_past:
          self.fill_with_past_key_values_(_UpperCAmelCase    ,			direction='''inputs'''							)
          lowercase__:   List[Any]					=      {0: '''batch''', 1: '''past_sequence + sequence'''}
       else:
          lowercase__:   Any					=      {0: '''batch''', 1: '''sequence'''}

       return common_inputs






    @property
    def _snake_case			(   self							):
       return self._config.n_layer






    @property
    def _snake_case			(   self							):
       return self._config.n_head






    def _snake_case			(   self    ,			_UpperCAmelCase    ,			_UpperCAmelCase = -1    ,			_UpperCAmelCase = -1    ,			_UpperCAmelCase = False    ,			_UpperCAmelCase = None    ,			):
       lowercase__:   List[Any]					=      super(_UpperCAmelCase    ,			self							).generate_dummy_inputs(
           _UpperCAmelCase    ,			batch_size=_UpperCAmelCase    ,			seq_length=_UpperCAmelCase    ,			is_pair=_UpperCAmelCase    ,			framework=_UpperCAmelCase							)

       # We need to order the input in the way they appears in the forward()
       lowercase__:   Optional[Any]					=      OrderedDict({'''input_ids''': common_inputs['''input_ids''']}							)

       # Need to add the past_keys
       if self.use_past:
          if not is_torch_available():
             raise ValueError('''Cannot generate dummy past_keys inputs without PyTorch installed.'''							)
          else:
             import torch

             lowercase__, lowercase__:   Tuple					=      common_inputs['''input_ids'''].shape
             # Not using the same length for past_key_values
             lowercase__:   Any					=      seqlen + 2
             lowercase__:   Any					=      (
                 batch,
                 self.num_attention_heads,
                 past_key_values_length,
                 self._config.hidden_size // self.num_attention_heads,
             )
             lowercase__:   Dict					=      [
                 (torch.zeros(_UpperCAmelCase							), torch.zeros(_UpperCAmelCase							)) for _ in range(self.num_layers							)
             ]

       lowercase__:   List[str]					=      common_inputs['''attention_mask''']
       if self.use_past:
          lowercase__:   Union[str, Any]					=      ordered_inputs['''attention_mask'''].dtype
          lowercase__:   List[Any]					=      torch.cat(
              [ordered_inputs['''attention_mask'''], torch.ones(_UpperCAmelCase    ,			_UpperCAmelCase    ,			dtype=_UpperCAmelCase							)]    ,			dim=1							)

       return ordered_inputs






    @property
    def _snake_case			(   self							):
       return 13

"""simple docstring"""






def SCREAMING_SNAKE_CASE__			(   __UpperCAmelCase=2_8_1_2_3 )  ->  Any:
   lowercase__:   Optional[Any]					=      [1] * (limit + 1)

   for i in range(2       ,    int(limit**0.5 ) + 1 ):
      sum_divs[i * i] += i
      for k in range(i + 1       ,    limit // i + 1 ):
         sum_divs[k * i] += k + i

   lowercase__:   Union[str, Any]					=      set()
   lowercase__:   Optional[Any]					=      0

   for n in range(1       ,    limit + 1 ):
      if sum_divs[n] > n:
         abundants.add(__UpperCAmelCase )

      if not any((n - a in abundants) for a in abundants ):
         res += n

   return res


if __name__ == "__main__":
       print(solution())
