


def   _lowerCAmelCase				(   UpperCamelCase__:     list						) ->   float:





	"""simple docstring"""







	A								=				0
	while len(UpperCamelCase__						) > 1:
		A								=				0
		# Consider two files with minimum cost to be merged
		for _ in range(2						):
			A								=				files.index(min(UpperCamelCase__						)						)
			temp += files[min_index]
			files.pop(UpperCamelCase__						)
		files.append(UpperCamelCase__						)
		optimal_merge_cost += temp
	return optimal_merge_cost


if __name__ == "__main__":
				import doctest

				doctest.testmod()







import copy

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


_lowercase       :      int	=	logging.get_logger(__name__)






class       _UpperCamelCase    (					__snake_case				):

				"""simple docstring"""







				lowerCAmelCase 		= 'upernet'

				def __init__(						self				,   a__=None				,   a__=512				,   a__=0.02				,   a__=[1, 2, 3, 6]				,   a__=True				,   a__=0.4				,   a__=384				,   a__=256				,   a__=1				,   a__=False				,   a__=255				,   **a__				,   )	->				Tuple:
					super().__init__(**a__   )

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

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

				def      _UpperCAmelCase					(						self   )	->				Dict:
					A								=				copy.deepcopy(self.__dict__   )
					A								=				self.backbone_config.to_dict()
					A								=				self.__class__.model_type
					return output



