'''simple docstring'''





from ...configuration_utils import PretrainedConfig
from ...utils import logging


SCREAMING_SNAKE_CASE_:     List[Any]  =logging.get_logger(__name__)

SCREAMING_SNAKE_CASE_:     List[str]  ={
    'funnel-transformer/small': 'https://huggingface.co/funnel-transformer/small/resolve/main/config.json',
    'funnel-transformer/small-base': 'https://huggingface.co/funnel-transformer/small-base/resolve/main/config.json',
    'funnel-transformer/medium': 'https://huggingface.co/funnel-transformer/medium/resolve/main/config.json',
    'funnel-transformer/medium-base': 'https://huggingface.co/funnel-transformer/medium-base/resolve/main/config.json',
    'funnel-transformer/intermediate': (
        'https://huggingface.co/funnel-transformer/intermediate/resolve/main/config.json'
    ),
    'funnel-transformer/intermediate-base': (
        'https://huggingface.co/funnel-transformer/intermediate-base/resolve/main/config.json'
    ),
    'funnel-transformer/large': 'https://huggingface.co/funnel-transformer/large/resolve/main/config.json',
    'funnel-transformer/large-base': 'https://huggingface.co/funnel-transformer/large-base/resolve/main/config.json',
    'funnel-transformer/xlarge': 'https://huggingface.co/funnel-transformer/xlarge/resolve/main/config.json',
    'funnel-transformer/xlarge-base': 'https://huggingface.co/funnel-transformer/xlarge-base/resolve/main/config.json',
}




class        __A      ( UpperCamelCase__	):
    a__       :						Optional[int]          =  """funnel"""
    a__       :						List[Any]          =  {
        """hidden_size""": """d_model""",
        """num_attention_heads""": """n_head""",
    }



    def __init__(self    :    Tuple   ,			__a    :    List[Any]=30522   ,			__a    :    List[Any]=[4, 4, 4]   ,			__a    :    str=None   ,			__a    :    Optional[Any]=2   ,			__a    :    List[str]=768   ,			__a    :    List[Any]=12   ,			__a    :    Dict=64   ,			__a    :    Optional[int]=3072   ,			__a    :    Optional[Any]="gelu_new"   ,			__a    :    List[str]=0.1   ,			__a    :    List[str]=0.1   ,			__a    :    Tuple=0.0   ,			__a    :    Dict=0.1   ,			__a    :    int=None   ,			__a    :    Tuple=1E-9   ,			__a    :    str="mean"   ,			__a    :    Optional[Any]="relative_shift"   ,			__a    :    Union[str, Any]=True   ,			__a    :    Union[str, Any]=True   ,			__a    :    List[str]=True   ,			**__a    :    List[Any]   ,			):
         UpperCAmelCase_           =   vocab_size
         UpperCAmelCase_           =   block_sizes
         UpperCAmelCase_           =   [1] * len(__a ) if block_repeats is None else block_repeats
         assert len(__a ) == len(
             self.block_repeats ), "`block_sizes` and `block_repeats` should have the same length."
         UpperCAmelCase_           =   num_decoder_layers
         UpperCAmelCase_           =   d_model
         UpperCAmelCase_           =   n_head
         UpperCAmelCase_           =   d_head
         UpperCAmelCase_           =   d_inner
         UpperCAmelCase_           =   hidden_act
         UpperCAmelCase_           =   hidden_dropout
         UpperCAmelCase_           =   attention_dropout
         UpperCAmelCase_           =   activation_dropout
         UpperCAmelCase_           =   initializer_range
         UpperCAmelCase_           =   initializer_std
         UpperCAmelCase_           =   layer_norm_eps
         assert pooling_type in [
             "mean",
             "max",
         ], f"""Got {pooling_type} for `pooling_type` but only 'mean' and 'max' are supported."""
         UpperCAmelCase_           =   pooling_type
         assert attention_type in [
             "relative_shift",
             "factorized",
         ], f"""Got {attention_type} for `attention_type` but only 'relative_shift' and 'factorized' are supported."""
         UpperCAmelCase_           =   attention_type
         UpperCAmelCase_           =   separate_cls
         UpperCAmelCase_           =   truncate_seq
         UpperCAmelCase_           =   pool_q_only

         super().__init__(**__a )



    @property
    def 					_lowercase						(self    :    Optional[Any] ):
         return sum(self.block_sizes )



    @num_hidden_layers.setter
    def 					_lowercase						(self    :    Optional[Any]   ,			__a    :    Union[str, Any] ):
         raise NotImplementedError(
             "This model does not support the setting of `num_hidden_layers`. Please set `block_sizes`." )



    @property
    def 					_lowercase						(self    :    Any ):
         return len(self.block_sizes )






    @num_blocks.setter
    def 					_lowercase						(self    :    int   ,			__a    :    Optional[int] ):
         raise NotImplementedError("This model does not support the setting of `num_blocks`. Please set `block_sizes`." )





'''simple docstring'''





import math





def 	lowerCAmelCase_				(					)    ->      None:


     '''simple docstring'''




     UpperCAmelCase_           =   input("Enter message: "			)
     UpperCAmelCase_           =   int(input(f"""Enter key [2-{len(snake_case_			) - 1}]: """			)			)
     UpperCAmelCase_           =   input("Encryption/Decryption [e/d]: "			)

     if mode.lower().startswith("e"			):
          UpperCAmelCase_           =   encrypt_message(snake_case_					,    snake_case_			)
     elif mode.lower().startswith("d"			):
          UpperCAmelCase_           =   decrypt_message(snake_case_					,    snake_case_			)

     # Append pipe symbol (vertical bar) to identify spaces at the end.
     print(f"""Output:\n{text + "|"}"""			)





def 	lowerCAmelCase_				(					snake_case_       : int					,    snake_case_       : str			)    ->      str:


     '''simple docstring'''




     UpperCAmelCase_           =   [""] * key
     for col in range(snake_case_			):
          UpperCAmelCase_           =   col
          while pointer < len(snake_case_			):
               cipher_text[col] += message[pointer]
               pointer += key
     return "".join(snake_case_			)





def 	lowerCAmelCase_				(					snake_case_       : int					,    snake_case_       : str			)    ->      str:


     '''simple docstring'''




     UpperCAmelCase_           =   math.ceil(len(snake_case_			) / key			)
     UpperCAmelCase_           =   key
     UpperCAmelCase_           =   (num_cols * num_rows) - len(snake_case_			)
     UpperCAmelCase_           =   [""] * num_cols
     UpperCAmelCase_           =   0
     UpperCAmelCase_           =   0

     for symbol in message:
          plain_text[col] += symbol
          col += 1

          if (
              (col == num_cols)
              or (col == num_cols - 1)
              and (row >= num_rows - num_shaded_boxes)
          ):
               UpperCAmelCase_           =   0
               row += 1

     return "".join(snake_case_			)


if __name__ == "__main__":
    import doctest

    doctest.testmod()
    main()




