"""simple docstring"""




def        lowerCAmelCase_			(					__A							)					->    list[list[int]]:







      '''simple docstring'''


      UpperCAmelCase__								=  []
      if len(lowerCamelCase_							) == 1:
            return [nums.copy()]
      for _ in range(len(lowerCamelCase_							)							):
            UpperCAmelCase__								=  nums.pop(0							)
            UpperCAmelCase__								=  permute(lowerCamelCase_							)
            for perm in permutations:
                  perm.append(lowerCamelCase_							)
            result.extend(lowerCamelCase_							)
            nums.append(lowerCamelCase_							)
      return result




def        lowerCAmelCase_			(					__A							)					->    Dict:







      '''simple docstring'''


      def backtrack(__A							):
            if start == len(lowerCamelCase_							) - 1:
                  output.append(nums[:]							)
            else:
                  for i in range(lowerCamelCase_,  len(lowerCamelCase_							)							):
                        UpperCAmelCase__								=  nums[i], nums[start]
                        backtrack(start + 1							)
                        UpperCAmelCase__								=  nums[i], nums[start]  # backtrack

      UpperCAmelCase__								=  []
      backtrack(0							)
      return output


if __name__ == "__main__":
      import doctest

      # use res to print the data in permute2 function
      UpperCamelCase__    							= permutea([1, 2, 3])
      print(res)
      doctest.testmod()




from typing import Callable, Optional, Union

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


UpperCamelCase__    							= logging.get_logger(__name__)

UpperCamelCase__    							= {
    'microsoft/xprophetnet-large-wiki100-cased': (
        'https://huggingface.co/microsoft/xprophetnet-large-wiki100-cased/resolve/main/config.json'
    ),
}





class 					A							(    UpperCAmelCase_					):
   __UpperCAmelCase			:			Optional[int]              =      'xlm-prophetnet'
   __UpperCAmelCase			:			int              =      ['past_key_values']
   __UpperCAmelCase			:			Optional[int]              =      {
       'num_attention_heads': 'num_encoder_attention_heads',
   }


   def __init__(self					:						str	,  __UpperCAmelCase					:						Optional[float] = 0.1	,  __UpperCAmelCase					:						Optional[Union[str, Callable]] = "gelu"	,  __UpperCAmelCase					:						Optional[int] = 3_0_5_2_2	,  __UpperCAmelCase					:						Optional[int] = 1_0_2_4	,  __UpperCAmelCase					:						Optional[int] = 4_0_9_6	,  __UpperCAmelCase					:						Optional[int] = 1_2	,  __UpperCAmelCase					:						Optional[int] = 1_6	,  __UpperCAmelCase					:						Optional[int] = 4_0_9_6	,  __UpperCAmelCase					:						Optional[int] = 1_2	,  __UpperCAmelCase					:						Optional[int] = 1_6	,  __UpperCAmelCase					:						Optional[float] = 0.1	,  __UpperCAmelCase					:						Optional[float] = 0.1	,  __UpperCAmelCase					:						Optional[int] = 5_1_2	,  __UpperCAmelCase					:						Optional[float] = 0.02	,  __UpperCAmelCase					:						Optional[bool] = True	,  __UpperCAmelCase					:						Optional[bool] = True	,  __UpperCAmelCase					:						Optional[int] = 0	,  __UpperCAmelCase					:						Optional[int] = 2	,  __UpperCAmelCase					:						Optional[int] = 3_2	,  __UpperCAmelCase					:						Optional[int] = 1_2_8	,  __UpperCAmelCase					:						Optional[bool] = False	,  __UpperCAmelCase					:						Optional[float] = 0.0	,  __UpperCAmelCase					:						Optional[bool] = True	,  __UpperCAmelCase					:						Optional[int] = 0	,  __UpperCAmelCase					:						Optional[int] = 1	,  __UpperCAmelCase					:						Optional[int] = 2	,  **__UpperCAmelCase					:						Optional[Any]	,  )						->    List[str]:
         """simple docstring"""



         UpperCAmelCase__								=  vocab_size
         UpperCAmelCase__								=  hidden_size
         UpperCAmelCase__								=  encoder_ffn_dim
         UpperCAmelCase__								=  num_encoder_layers
         UpperCAmelCase__								=  num_encoder_attention_heads
         UpperCAmelCase__								=  decoder_ffn_dim
         UpperCAmelCase__								=  num_decoder_layers
         UpperCAmelCase__								=  num_decoder_attention_heads
         UpperCAmelCase__								=  max_position_embeddings
         UpperCAmelCase__								=  init_std  # Normal(0, this parameter)
         UpperCAmelCase__								=  activation_function

         # parameters for xlmprophetnet
         UpperCAmelCase__								=  ngram
         UpperCAmelCase__								=  num_buckets
         UpperCAmelCase__								=  relative_max_distance
         UpperCAmelCase__								=  disable_ngram_loss
         UpperCAmelCase__								=  eps

         # 3 Types of Dropout
         UpperCAmelCase__								=  attention_dropout
         UpperCAmelCase__								=  activation_dropout
         UpperCAmelCase__								=  dropout

         UpperCAmelCase__								=  use_cache

         super().__init__(
             pad_token_id=__UpperCAmelCase	,  bos_token_id=__UpperCAmelCase	,  eos_token_id=__UpperCAmelCase	,  is_encoder_decoder=__UpperCAmelCase	,  add_cross_attention=__UpperCAmelCase	,  decoder_start_token_id=__UpperCAmelCase	,  **__UpperCAmelCase	,  )


   @property
   def       lowercase_				(self					:						int		)						->    int:
         """simple docstring"""



         return self.num_encoder_layers + self.num_decoder_layers





   @num_hidden_layers.setter
   def       lowercase_				(self					:						Any	,  __UpperCAmelCase					:						List[Any]		)						->    Union[str, Any]:
         """simple docstring"""



         raise NotImplementedError(
             "This model does not support the setting of `num_hidden_layers`. Please set `num_encoder_layers` and"
             " `num_decoder_layers`."		)



