






'''simple docstring'''


import copy

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


lowerCamelCase_				: Dict    	=							logging.get_logger(__name__)
class    _SCREAMING_SNAKE_CASE							(		SCREAMING_SNAKE_CASE_	):


			'''simple docstring'''





			__a							:							Union[str, Any]					     =					"upernet"






			def __init__(   self							:						List[str] ,      lowercase							:						int=None ,      lowercase							:						str=5_1_2 ,      lowercase							:						List[Any]=0.0_2 ,      lowercase							:						List[Any]=[1, 2, 3, 6] ,      lowercase							:						Optional[int]=True ,      lowercase							:						List[Any]=0.4 ,      lowercase							:						List[str]=3_8_4 ,      lowercase							:						List[Any]=2_5_6 ,      lowercase							:						Optional[Any]=1 ,      lowercase							:						int=False ,      lowercase							:						int=2_5_5 ,      **lowercase							:						str ,      )							->    Optional[Any]:

									'''simple docstring'''







									super().__init__(**UpperCamelCase__			)

									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(UpperCamelCase__ ,      UpperCamelCase__			):
															UpperCamelCase__         = backbone_config.get("""model_type"""			)
															UpperCamelCase__         = CONFIG_MAPPING[backbone_model_type]
															UpperCamelCase__         = config_class.from_dict(UpperCamelCase__			)

									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 				A      (   self							:						Optional[int]			)							->    int:

									'''simple docstring'''







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








'''simple docstring'''


import math







def 	__magic_name__( _A					):
						'''simple docstring'''





						assert isinstance(_A						,      _A					) and (
						    number >= 0
						), "'number' must been an int and positive"

						if 1 < number < 4:
												# 2 and 3 are primes
												return True
						elif number < 2 or not number % 2:
												# Negatives, 0, 1 and all even numbers are not primes
												return False

						UpperCamelCase__         = range(3						,      int(math.sqrt(_A					) + 1					)						,      2					)
						return not any(not number % i for i in odd_numbers					)







def 	__magic_name__( _A						,      _A=1						,      **_A					):
						'''simple docstring'''





						UpperCamelCase__         = factor * value
						UpperCamelCase__         = value

						while not is_prime(_A					):
												value += 1 if not ("desc" in kwargs and kwargs["desc"] is True) else -1

						if value == first_value_val:
												return next_prime(value + 1						,      **_A					)
						return value
