

import copy

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ..auto.configuration_auto import AutoConfig


lowerCAmelCase_ 			=			logging.get_logger(__name__)





class 			snake_case_     (	__A      ):







			'''simple docstring'''

			SCREAMING_SNAKE_CASE  :     Optional[Any]		    =       "speech-encoder-decoder"
			SCREAMING_SNAKE_CASE  :     List[Any]		    =       True







			def __init__(  self				:       Dict							,     **_UpperCamelCase				:       int							)   ->Union[str, Any]:
									super().__init__(**_UpperCamelCase							)
									if "encoder" not in kwargs or "decoder" not in kwargs:
															raise ValueError(
															    f'''A configuraton of type {self.model_type} cannot be instantiated because not both `encoder` and'''
															    f''' `decoder` sub-configurations are passed, but only {kwargs}'''							)

									snake_case_     =			kwargs.pop('''encoder'''							)
									snake_case_     =			encoder_config.pop('''model_type'''							)
									snake_case_     =			kwargs.pop('''decoder'''							)
									snake_case_     =			decoder_config.pop('''model_type'''							)

									snake_case_     =			AutoConfig.for_model(_UpperCamelCase							,     **_UpperCamelCase							)
									snake_case_     =			AutoConfig.for_model(_UpperCamelCase							,     **_UpperCamelCase							)
									snake_case_     =			True







			@classmethod
			def        snake_case__(  cls				:       str							,     _UpperCamelCase				:       PretrainedConfig							,     _UpperCamelCase				:       PretrainedConfig							,     **_UpperCamelCase				:       str							)   ->PretrainedConfig:
									logger.info('''Setting `config.is_decoder=True` and `config.add_cross_attention=True` for decoder_config'''							)
									snake_case_     =			True
									snake_case_     =			True

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







			def        snake_case__(  self				:       List[str]							)   ->Union[str, Any]:
									snake_case_     =			copy.deepcopy(self.__dict__							)
									snake_case_     =			self.encoder.to_dict()
									snake_case_     =			self.decoder.to_dict()
									snake_case_     =			self.__class__.model_type
									return output


def 						__SCREAMING_SNAKE_CASE      (SCREAMING_SNAKE_CASE__						,	SCREAMING_SNAKE_CASE__ ):
						return (input_a, input_a).count(0 ) % 2


def 						__SCREAMING_SNAKE_CASE      ():
						assert xor_gate(0						,	0 ) == 0
						assert xor_gate(0						,	1 ) == 1
						assert xor_gate(1						,	0 ) == 1
						assert xor_gate(1						,	1 ) == 0


if __name__ == "__main__":
					print(xor_gate(0, 0))
					print(xor_gate(0, 1))