



import logging

from transformers import PretrainedConfig


__lowerCamelCase			       =			logging.getLogger(__name__)


__lowerCamelCase			       =			{
    '''bertabs-finetuned-cnndm''': '''https://huggingface.co/remi/bertabs-finetuned-cnndm-extractive-abstractive-summarization/resolve/main/config.json''',
}


class   snake_case_ (lowercase__  ):




       """simple docstring"""






       _lowerCamelCase			    =				"""bertabs"""



       def __init__(     self     ,lowercase=30522     ,lowercase=512     ,lowercase=6     ,lowercase=512     ,lowercase=8     ,lowercase=512     ,lowercase=0.2     ,lowercase=6     ,lowercase=768     ,lowercase=8     ,lowercase=2048     ,lowercase=0.2     ,**lowercase     ,):

             """simple docstring"""





             super().__init__(**lowercase)

             UpperCAmelCase_  :	Any				      =		vocab_size
             UpperCAmelCase_  :	int				      =		max_pos

             UpperCAmelCase_  :	List[str]				      =		enc_layers
             UpperCAmelCase_  :	List[str]				      =		enc_hidden_size
             UpperCAmelCase_  :	Any				      =		enc_heads
             UpperCAmelCase_  :	Any				      =		enc_ff_size
             UpperCAmelCase_  :	Optional[int]				      =		enc_dropout

             UpperCAmelCase_  :	List[str]				      =		dec_layers
             UpperCAmelCase_  :	List[Any]				      =		dec_hidden_size
             UpperCAmelCase_  :	List[str]				      =		dec_heads
             UpperCAmelCase_  :	List[Any]				      =		dec_ff_size
             UpperCAmelCase_  :	List[str]				      =		dec_dropout





import operator







def    _snake_case (       __snake_case					,  __snake_case = False					,  __snake_case = None    )     ->     list:






      '''simple docstring'''







      UpperCAmelCase_  :	Optional[int]				      =		operator.lt if reverse else operator.gt
      UpperCAmelCase_  :	int				      =		solution or []

      if not arr:
            return solution

      UpperCAmelCase_  :	Union[str, Any]				      =		[arr.pop(0    )]
      for i, item in enumerate(__snake_case    ):
            if _operator(__snake_case					,  sublist[-1]    ):
                  sublist.append(__snake_case    )
                  arr.pop(__snake_case    )

    #  merging sublist into solution list
      if not solution:
            solution.extend(__snake_case    )
      else:
            while sublist:
                  UpperCAmelCase_  :	Optional[int]				      =		sublist.pop(0    )
                  for i, xx in enumerate(__snake_case    ):
                        if not _operator(__snake_case					,  __snake_case    ):
                              solution.insert(__snake_case					,  __snake_case    )
                              break
                  else:
                        solution.append(__snake_case    )

      strand_sort(__snake_case					,  __snake_case					,  __snake_case    )
      return solution


if __name__ == "__main__":
   assert strand_sort([4, 3, 5, 1, 2]) == [1, 2, 3, 4, 5]
   assert strand_sort([4, 3, 5, 1, 2], reverse=True) == [5, 4, 3, 2, 1]
