'''simple docstring'''




import copy

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


__UpperCAmelCase												=	logging.get_logger(__name__)




class    a__				(       UpperCAmelCase__			):
     lowerCamelCase  :					Optional[Any]							="encoder-decoder"
     lowerCamelCase  :					Dict							=True






     def __init__(			self		:		Tuple  ,    **a		:		List[str]   ):





         """simple docstring"""



         super().__init__(**a   )
         assert (
             "encoder" in kwargs and "decoder" in kwargs
         ), "Config has to be initialized with encoder and decoder config"
         __lowerCamelCase          =  kwargs.pop('''encoder'''   )
         __lowerCamelCase          =  encoder_config.pop('''model_type'''   )
         __lowerCamelCase          =  kwargs.pop('''decoder'''   )
         __lowerCamelCase          =  decoder_config.pop('''model_type'''   )

         from ..auto.configuration_auto import AutoConfig

         __lowerCamelCase          =  AutoConfig.for_model(a  ,    **a   )
         __lowerCamelCase          =  AutoConfig.for_model(a  ,    **a   )
         __lowerCamelCase          =  True






     @classmethod
     def        SCREAMING_SNAKE_CASE__       (			cls		:		Dict  ,    a		:		PretrainedConfig  ,    a		:		PretrainedConfig  ,    **a		:		Union[str, Any]   ):





         """simple docstring"""



         logger.info('''Set `config.is_decoder=True` and `config.add_cross_attention=True` for decoder_config'''   )
         __lowerCamelCase          =  True
         __lowerCamelCase          =  True

         return cls(encoder=encoder_config.to_dict()  ,    decoder=decoder_config.to_dict()  ,    **a   )






     def        SCREAMING_SNAKE_CASE__       (			self		:		List[str]   ):





         """simple docstring"""



         __lowerCamelCase          =  copy.deepcopy(self.__dict__   )
         __lowerCamelCase          =  self.encoder.to_dict()
         __lowerCamelCase          =  self.decoder.to_dict()
         __lowerCamelCase          =  self.__class__.model_type
         return output

'''simple docstring'''




from __future__ import annotations

from typing import Any






def __lowerCAmelCase			(							UpperCamelCase__    )     ->   None:
    create_state_space_tree(UpperCamelCase__    ,  []    ,  0    )






def __lowerCAmelCase			(							UpperCamelCase__    ,  UpperCamelCase__    ,  UpperCamelCase__    )     ->   None:

    if index == len(UpperCamelCase__    ):
        print(UpperCamelCase__    )
        return

    create_state_space_tree(UpperCamelCase__    ,  UpperCamelCase__    ,  index + 1    )
    current_subsequence.append(sequence[index]    )
    create_state_space_tree(UpperCamelCase__    ,  UpperCamelCase__    ,  index + 1    )
    current_subsequence.pop()


if __name__ == "__main__":
  __UpperCAmelCase												=[3, 1, 2, 4]
  generate_all_subsequences(seq)

  seq.clear()
  seq.extend(["A", "B", "C"])
  generate_all_subsequences(seq)
