code: 
  import copy
  
  from ...configuration_utils import PretrainedConfig
  from ...utils import logging
  
  
  __lowerCamelCase       :       Dict				   =			logging.get_logger(__name__)
  
  __lowerCamelCase       :       Tuple				   =			{
      '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      (      lowercase_   ):
  
  
  
  
  
  
  		def __init__(  self	,     __UpperCamelCase=2_56	,     __UpperCamelCase=10_24	,     __UpperCamelCase=16	,     __UpperCamelCase=16	,     __UpperCamelCase=4	,     __UpperCamelCase="gelu"	,     __UpperCamelCase=1E-6	,     **__UpperCamelCase	,     )->			List[Any]:
  						'''simple docstring'''
  
  
  						super().__init__(**__UpperCamelCase							)
  						A__     :							List[str]   				=hidden_size
  						A__     :							Optional[Any]   				=image_size
  						A__     :							Tuple   				=patch_size
  						A__     :							List[Any]   				=image_size // patch_size
  						A__     :							List[Any]   				=mask_input_channels
  						A__     :							Optional[Any]   				=num_point_embeddings
  						A__     :							Optional[int]   				=hidden_act
  						A__     :							List[Any]   				=layer_norm_eps
  
  
  
  
  
  
  
  class 			a      (      lowercase_   ):
  
  
  
  
  
  
  		def __init__(  self	,     __UpperCamelCase=2_56	,     __UpperCamelCase="relu"	,     __UpperCamelCase=20_48	,     __UpperCamelCase=2	,     __UpperCamelCase=8	,     __UpperCamelCase=2	,     __UpperCamelCase=3	,     __UpperCamelCase=3	,     __UpperCamelCase=2_56	,     __UpperCamelCase=1E-6	,     **__UpperCamelCase	,     )->			List[str]:
  						'''simple docstring'''
  
  
  						super().__init__(**__UpperCamelCase							)
  						A__     :							str   				=hidden_size
  						A__     :							List[str]   				=hidden_act
  						A__     :							str   				=mlp_dim
  						A__     :							Dict   				=num_hidden_layers
  						A__     :							Any   				=num_attention_heads
  						A__     :							Optional[int]   				=attention_downsample_rate
  						A__     :							str   				=num_multimask_outputs
  						A__     :							int   				=iou_head_depth
  						A__     :							Union[str, Any]   				=iou_head_hidden_dim
  						A__     :							Union[str, Any]   				=layer_norm_eps
  
  
  
  
  
  
  
  class 			a      (      lowercase_   ):
  
  
  
  
  
  
  		def __init__(  self	,     __UpperCamelCase=7_68	,     __UpperCamelCase=2_56	,     __UpperCamelCase=12	,     __UpperCamelCase=12	,     __UpperCamelCase=3	,     __UpperCamelCase=10_24	,     __UpperCamelCase=16	,     __UpperCamelCase="gelu"	,     __UpperCamelCase=1E-06	,     __UpperCamelCase=0.0	,     __UpperCamelCase=1E-10	,     __UpperCamelCase=True	,     __UpperCamelCase=4.0	,     __UpperCamelCase=True	,     __UpperCamelCase=True	,     __UpperCamelCase=14	,     __UpperCamelCase=[2, 5, 8, 11]	,     __UpperCamelCase=1_28	,     __UpperCamelCase=None	,     **__UpperCamelCase	,     )->			List[str]:
  						'''simple docstring'''
  
  
  						super().__init__(**__UpperCamelCase							)
  
  						A__     :							Optional[Any]   				=hidden_size
  						A__     :							Optional[Any]   				=output_channels
  						A__     :							Tuple   				=num_hidden_layers
  						A__     :							Dict   				=num_attention_heads
  						A__     :							Optional[int]   				=num_channels
  						A__     :							str   				=image_size
  						A__     :							List[Any]   				=patch_size
  						A__     :							Tuple   				=hidden_act
  						A__     :							Tuple   				=layer_norm_eps
  						A__     :							Optional[Any]   				=attention_dropout
  						A__     :							List[Any]   				=initializer_range
  						A__     :							Dict   				=qkv_bias
  						A__     :							Optional[int]   				=mlp_ratio
  						A__     :							int   				=use_abs_pos
  						A__     :							List[str]   				=use_rel_pos
  						A__     :							str   				=window_size
  						A__     :							int   				=global_attn_indexes
  						A__     :							Dict   				=num_pos_feats
  						A__     :							int   				=int(hidden_size * mlp_ratio							) if mlp_dim is None else mlp_dim
  
  
  
  
  
  
  
  class 			a      (      lowercase_   ):
  		__lowercase													=		"""sam"""
  		__lowercase													=		True
  
  
  
  
  
  
  		def __init__(  self	,     __UpperCamelCase=None	,     __UpperCamelCase=None	,     __UpperCamelCase=None	,     __UpperCamelCase=0.02	,     **__UpperCamelCase	,     )->			Optional[Any]:
  						'''simple docstring'''
  
  
  						super().__init__(**__UpperCamelCase							)
  						A__     :							List[str]   				=vision_config if vision_config is not None else {}
  						A__     :							Any   				=prompt_encoder_config if prompt_encoder_config is not None else {}
  						A__     :							Union[str, Any]   				=mask_decoder_config if mask_decoder_config is not None else {}
  
  						if isinstance(__UpperCamelCase	,     __UpperCamelCase							):
  										A__     :							Optional[int]   				=vision_config.to_dict()
  						if isinstance(__UpperCamelCase	,     __UpperCamelCase							):
  										A__     :							List[Any]   				=prompt_encoder_config.to_dict()
  						if isinstance(__UpperCamelCase	,     __UpperCamelCase							):
  										A__     :							Any   				=mask_decoder_config.to_dict()
  
  						A__     :							List[Any]   				=SamVisionConfig(**__UpperCamelCase							)
  						A__     :							int   				=SamPromptEncoderConfig(**__UpperCamelCase							)
  						A__     :							Any   				=SamMaskDecoderConfig(**__UpperCamelCase							)
  						A__     :							Optional[int]   				=initializer_range
  
  
  
  
  
  
  		def       lowerCAmelCase_  (  self							)->			Any:
  						'''simple docstring'''
  
  
  						A__     :							List[str]   				=copy.deepcopy(self.__dict__							)
  						A__     :							Dict   				=self.vision_config.to_dict()
  						A__     :							int   				=self.prompt_encoder_config.to_dict()
  						A__     :							Union[str, Any]   				=self.mask_decoder_config.to_dict()
  						A__     :							Optional[Any]   				=self.__class__.model_type
  						return output
  
  
  
  
style_context: 
  
  
  def   SCREAMING_SNAKE_CASE__						(							snake_case_	)			->							int:
  				barcode //= 1_0  # exclude the last digit
  				A__     :							List[str]   				=False
  				A__     :							Dict   				=0
  
  				# extract and check each digit
  				while barcode != 0:
  								A__     :							Union[str, Any]   				=1 if checker else 3
  								s += mult * (barcode % 1_0)
  								barcode //= 1_0
  								A__     :							Union[str, Any]   				=not checker
  
  				return (1_0 - (s % 1_0)) % 1_0
  
  
  
  def   SCREAMING_SNAKE_CASE__						(							snake_case_	)			->							bool:
  				return len(str(snake_case_	)	) == 1_3 and get_check_digit(snake_case_	) == barcode % 1_0
  
  
  
  def   SCREAMING_SNAKE_CASE__						(							snake_case_	)			->							int:
  				if str(snake_case_	).isalpha():
  								A__     :							Tuple   				=f'Barcode \'{barcode}\' has alphabetic characters.'
  								raise ValueError(snake_case_	)
  				elif int(snake_case_	) < 0:
  								raise ValueError('''The entered barcode has a negative value. Try again.'''	)
  				else:
  								return int(snake_case_	)
  
  
  if __name__ == "__main__":
  						import doctest
  
  						doctest.testmod()
  						__lowerCamelCase       :       List[Any]				   =			get_barcode(input("Barcode: ").strip())
  
  						if is_valid(barcode):
  												print(F"'{barcode}' is a valid barcode.")
  						else:
  												print(F"'{barcode}' is NOT a valid barcode.")
  
  
  
  