





import copy

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


__A				:    Union[str, Any]       =   logging.get_logger(__name__)

class 	A_       (a_			):
	UpperCAmelCase__					=			'''upernet'''
	def __init__(    self							,					_A=None							,					_A=5_1_2							,					_A=0.02							,					_A=[1, 2, 3, 6]							,					_A=True							,					_A=0.4							,					_A=3_8_4							,					_A=2_5_6							,					_A=1							,					_A=False							,					_A=2_5_5							,					**_A							,					):






				'''simple docstring'''







				super().__init__(**_A		)

				if backbone_config is None:
							logger.info('''`backbone_config` is `None`. Initializing the config with the default `ResNet` backbone.'''		)
							UpperCAmelCase   		=				CONFIG_MAPPING['''resnet'''](out_features=['''stage1''', '''stage2''', '''stage3''', '''stage4''']		)
				elif isinstance(_A							,					_A		):
							UpperCAmelCase   		=				backbone_config.get('''model_type'''		)
							UpperCAmelCase   		=				CONFIG_MAPPING[backbone_model_type]
							UpperCAmelCase   		=				config_class.from_dict(_A		)

				UpperCAmelCase   		=				backbone_config
				UpperCAmelCase   		=				hidden_size
				UpperCAmelCase   		=				initializer_range
				UpperCAmelCase   		=				pool_scales
				UpperCAmelCase   		=				use_auxiliary_head
				UpperCAmelCase   		=				auxiliary_loss_weight
				UpperCAmelCase   		=				auxiliary_in_channels
				UpperCAmelCase   		=				auxiliary_channels
				UpperCAmelCase   		=				auxiliary_num_convs
				UpperCAmelCase   		=				auxiliary_concat_input
				UpperCAmelCase   		=				loss_ignore_index







	def      _lowercase				(    self		):






				'''simple docstring'''







				UpperCAmelCase   		=				copy.deepcopy(self.__dict__		)
				UpperCAmelCase   		=				self.backbone_config.to_dict()
				UpperCAmelCase   		=				self.__class__.model_type
				return output










def 						__SCREAMING_SNAKE_CASE  (				UpperCamelCase__			,			UpperCamelCase__			,			UpperCamelCase__ )  ->				int:







			'''simple docstring'''

			if exponent == 1:
						return base
			if exponent % 2 == 0:
						UpperCAmelCase   		=				_modexpt(UpperCamelCase__			,			exponent // 2			,			UpperCamelCase__ ) % modulo_value
						return (x * x) % modulo_value
			else:
						return (base * _modexpt(UpperCamelCase__			,			exponent - 1			,			UpperCamelCase__ )) % modulo_value





def 						__SCREAMING_SNAKE_CASE  (				UpperCamelCase__ = 1777			,			UpperCamelCase__ = 1855			,			UpperCamelCase__ = 8 )  ->				int:







			'''simple docstring'''

			UpperCAmelCase   		=				base
			for _ in range(1			,			UpperCamelCase__ ):
						UpperCAmelCase   		=				_modexpt(UpperCamelCase__			,			UpperCamelCase__			,			10**digits )

			return result


if __name__ == "__main__":
				print(F'{solution() = }')



