




'''simple docstring'''


import copy

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


_snake_case      :      int   							=		logging.get_logger(__name__)

_snake_case      :      Optional[Any]   							=		{
    'facebook/sam-vit-huge': 'https://huggingface.co/facebook/sam-vit-huge/resolve/main/config.json',
    'facebook/sam-vit-large': 'https://huggingface.co/facebook/sam-vit-large/resolve/main/config.json',
    'facebook/sam-vit-base': 'https://huggingface.co/facebook/sam-vit-base/resolve/main/config.json',
}

class 			A    (		UpperCAmelCase_    ):







							def __init__(  self       :  Tuple							,			lowerCAmelCase_       :  int=2_56							,			lowerCAmelCase_       :  int=10_24							,			lowerCAmelCase_       :  int=16							,			lowerCAmelCase_       :  Tuple=16							,			lowerCAmelCase_       :  Optional[Any]=4							,			lowerCAmelCase_       :  List[Any]="gelu"							,			lowerCAmelCase_       :  Optional[Any]=1e-6							,			**lowerCAmelCase_       :  Optional[Any]							,			)			->							Dict:


														"""simple docstring"""


														super().__init__(**__UpperCamelCase					)
														_a	     =				hidden_size
														_a	     =				image_size
														_a	     =				patch_size
														_a	     =				image_size // patch_size
														_a	     =				mask_input_channels
														_a	     =				num_point_embeddings
														_a	     =				hidden_act
														_a	     =				layer_norm_eps



class 			A    (		UpperCAmelCase_    ):







							def __init__(  self       :  Union[str, Any]							,			lowerCAmelCase_       :  Optional[Any]=2_56							,			lowerCAmelCase_       :  Union[str, Any]="relu"							,			lowerCAmelCase_       :  Union[str, Any]=20_48							,			lowerCAmelCase_       :  Dict=2							,			lowerCAmelCase_       :  Optional[Any]=8							,			lowerCAmelCase_       :  Any=2							,			lowerCAmelCase_       :  str=3							,			lowerCAmelCase_       :  Optional[Any]=3							,			lowerCAmelCase_       :  List[str]=2_56							,			lowerCAmelCase_       :  Any=1e-6							,			**lowerCAmelCase_       :  Any							,			)			->							Tuple:


														"""simple docstring"""


														super().__init__(**__UpperCamelCase					)
														_a	     =				hidden_size
														_a	     =				hidden_act
														_a	     =				mlp_dim
														_a	     =				num_hidden_layers
														_a	     =				num_attention_heads
														_a	     =				attention_downsample_rate
														_a	     =				num_multimask_outputs
														_a	     =				iou_head_depth
														_a	     =				iou_head_hidden_dim
														_a	     =				layer_norm_eps



class 			A    (		UpperCAmelCase_    ):







							def __init__(  self       :  Any							,			lowerCAmelCase_       :  Optional[int]=7_68							,			lowerCAmelCase_       :  Any=2_56							,			lowerCAmelCase_       :  List[str]=12							,			lowerCAmelCase_       :  Optional[int]=12							,			lowerCAmelCase_       :  str=3							,			lowerCAmelCase_       :  Union[str, Any]=10_24							,			lowerCAmelCase_       :  str=16							,			lowerCAmelCase_       :  List[Any]="gelu"							,			lowerCAmelCase_       :  int=1e-06							,			lowerCAmelCase_       :  int=0.0							,			lowerCAmelCase_       :  Tuple=1e-10							,			lowerCAmelCase_       :  Union[str, Any]=True							,			lowerCAmelCase_       :  Union[str, Any]=4.0							,			lowerCAmelCase_       :  Dict=True							,			lowerCAmelCase_       :  Optional[int]=True							,			lowerCAmelCase_       :  Tuple=14							,			lowerCAmelCase_       :  Optional[Any]=[2, 5, 8, 11]							,			lowerCAmelCase_       :  List[str]=1_28							,			lowerCAmelCase_       :  List[Any]=None							,			**lowerCAmelCase_       :  Union[str, Any]							,			)			->							Optional[int]:


														"""simple docstring"""


														super().__init__(**__UpperCamelCase					)

														_a	     =				hidden_size
														_a	     =				output_channels
														_a	     =				num_hidden_layers
														_a	     =				num_attention_heads
														_a	     =				num_channels
														_a	     =				image_size
														_a	     =				patch_size
														_a	     =				hidden_act
														_a	     =				layer_norm_eps
														_a	     =				attention_dropout
														_a	     =				initializer_range
														_a	     =				qkv_bias
														_a	     =				mlp_ratio
														_a	     =				use_abs_pos
														_a	     =				use_rel_pos
														_a	     =				window_size
														_a	     =				global_attn_indexes
														_a	     =				num_pos_feats
														_a	     =				int(hidden_size * mlp_ratio					) if mlp_dim is None else mlp_dim



class 			A    (		UpperCAmelCase_    ):
							lowercase_							=				'sam'
							lowercase_							=				True







							def __init__(  self       :  List[str]							,			lowerCAmelCase_       :  Optional[int]=None							,			lowerCAmelCase_       :  str=None							,			lowerCAmelCase_       :  Any=None							,			lowerCAmelCase_       :  Union[str, Any]=0.0_2							,			**lowerCAmelCase_       :  Optional[int]							,			)			->							Optional[Any]:


														"""simple docstring"""


														super().__init__(**__UpperCamelCase					)
														_a	     =				vision_config if vision_config is not None else {}
														_a	     =				prompt_encoder_config if prompt_encoder_config is not None else {}
														_a	     =				mask_decoder_config if mask_decoder_config is not None else {}

														if isinstance(__UpperCamelCase							,			__UpperCamelCase					):
																					_a	     =				vision_config.to_dict()
														if isinstance(__UpperCamelCase							,			__UpperCamelCase					):
																					_a	     =				prompt_encoder_config.to_dict()
														if isinstance(__UpperCamelCase							,			__UpperCamelCase					):
																					_a	     =				mask_decoder_config.to_dict()

														_a	     =				SamVisionConfig(**__UpperCamelCase					)
														_a	     =				SamPromptEncoderConfig(**__UpperCamelCase					)
														_a	     =				SamMaskDecoderConfig(**__UpperCamelCase					)
														_a	     =				initializer_range







							def    __lowerCAmelCase			(  self       :  Any					)			->							Optional[int]:


														"""simple docstring"""


														_a	     =				copy.deepcopy(self.__dict__					)
														_a	     =				self.vision_config.to_dict()
														_a	     =				self.prompt_encoder_config.to_dict()
														_a	     =				self.mask_decoder_config.to_dict()
														_a	     =				self.__class__.model_type
														return output







'''simple docstring'''







from __future__ import annotations

import math
from itertools import permutations






def 		_lowercase		(	lowercase_  ):



		'''simple docstring'''







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

		# All primes number are in format of 6k +/- 1
		for i in range(5						,							int(math.sqrt(lowercase_  ) + 1  )						,							6  ):
				if number % i == 0 or number % (i + 2) == 0:
						return False
		return True






def 		_lowercase		(	lowercase_ = 7  ):



		'''simple docstring'''







		_snake_case	       =       "".join(str(lowercase_  ) for i in range(1						,							n + 1  )  )
		_snake_case	       =       [int("".join(lowercase_  )  ) for i in permutations(lowercase_						,							lowercase_  )]
		_snake_case	       =       [num for num in perm_list if is_prime(lowercase_  )]
		return max(lowercase_  ) if pandigitals else 0


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





