



'''simple docstring'''


from dataclasses import asdict, dataclass
from typing import Optional

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


lowercase_      :				List[Any]   					=    logging.get_logger(__name__)

# TODO Update this
lowercase_      :				str   					=    {
    '''facebook/esm-1b''': '''https://huggingface.co/facebook/esm-1b/resolve/main/config.json''',
    # See all ESM models at https://huggingface.co/models?filter=esm
}




class      __UpperCamelCase       (_UpperCAmelCase			):
	__A			  =					'''esm'''







	def __init__(    self ,				_lowerCAmelCase=None ,				_lowerCAmelCase=None ,				_lowerCAmelCase=None ,				_lowerCAmelCase=768 ,				_lowerCAmelCase=12 ,				_lowerCAmelCase=12 ,				_lowerCAmelCase=3072 ,				_lowerCAmelCase=0.1 ,				_lowerCAmelCase=0.1 ,				_lowerCAmelCase=1026 ,				_lowerCAmelCase=0.02 ,				_lowerCAmelCase=1E-12 ,				_lowerCAmelCase="absolute" ,				_lowerCAmelCase=True ,				_lowerCAmelCase=None ,				_lowerCAmelCase=False ,				_lowerCAmelCase=False ,				_lowerCAmelCase=None ,				_lowerCAmelCase=None ,				**_lowerCAmelCase ,				)    ->    Dict:
							'''simple docstring'''






							super().__init__(pad_token_id=_lowerCAmelCase ,				mask_token_id=_lowerCAmelCase ,				**_lowerCAmelCase						)

							lowercase        =							vocab_size
							lowercase        =							hidden_size
							lowercase        =							num_hidden_layers
							lowercase        =							num_attention_heads
							lowercase        =							intermediate_size
							lowercase        =							hidden_dropout_prob
							lowercase        =							attention_probs_dropout_prob
							lowercase        =							max_position_embeddings
							lowercase        =							initializer_range
							lowercase        =							layer_norm_eps
							lowercase        =							position_embedding_type
							lowercase        =							use_cache
							lowercase        =							emb_layer_norm_before
							lowercase        =							token_dropout
							lowercase        =							is_folding_model
							if is_folding_model:
													if esmfold_config is None:
																			logger.info("""No esmfold_config supplied for folding model, using default values."""						)
																			lowercase        =							EsmFoldConfig()
													elif isinstance(_lowerCAmelCase ,				_lowerCAmelCase						):
																			lowercase        =							EsmFoldConfig(**_lowerCAmelCase						)
													lowercase        =							esmfold_config
													if vocab_list is None:
																			logger.warning("""No vocab_list supplied for folding model, assuming the ESM-2 vocabulary!"""						)
																			lowercase        =							get_default_vocab_list()
													else:
																			lowercase        =							vocab_list
							else:
													lowercase        =							None
													lowercase        =							None
							if self.esmfold_config is not None and getattr(self.esmfold_config ,				"""use_esm_attn_map""" ,				_lowerCAmelCase						):
													raise ValueError("""The HuggingFace port of ESMFold does not support use_esm_attn_map at this time!"""						)







	def   _a   (    self						)    ->    List[str]:
							'''simple docstring'''






							lowercase        =							super().to_dict()
							if isinstance(self.esmfold_config ,				_lowerCAmelCase						):
													lowercase        =							self.esmfold_config.to_dict()
							return output




@dataclass
class      __UpperCamelCase       :
	__A			  =					None
	__A			  =					True
	__A			  =					False
	__A			  =					False
	__A			  =					False
	__A			  =					0

	__A			  =					True
	__A			  =					False

	__A			  =					128
	__A			  =					None







	def   _a   (    self						)    ->    int:
							'''simple docstring'''






							if self.trunk is None:
													lowercase        =							TrunkConfig()
							elif isinstance(self.trunk ,				_lowerCAmelCase						):
													lowercase        =							TrunkConfig(**self.trunk						)







	def   _a   (    self						)    ->    Dict:
							'''simple docstring'''






							lowercase        =							asdict(self						)
							lowercase        =							self.trunk.to_dict()
							return output




@dataclass
class      __UpperCamelCase       :
	__A			  =					48
	__A			  =					1024
	__A			  =					128
	__A			  =					32
	__A			  =					32
	__A			  =					32
	__A			  =					0
	__A			  =					0
	__A			  =					False
	__A			  =					4
	__A			  =					128
	__A			  =					None







	def   _a   (    self						)    ->    int:
							'''simple docstring'''






							if self.structure_module is None:
													lowercase        =							StructureModuleConfig()
							elif isinstance(self.structure_module ,				_lowerCAmelCase						):
													lowercase        =							StructureModuleConfig(**self.structure_module						)

							if self.max_recycles <= 0:
													raise ValueError(F"""`max_recycles` should be positive, got {self.max_recycles}."""						)
							if self.sequence_state_dim % self.sequence_state_dim != 0:
													raise ValueError(
													    """`sequence_state_dim` should be a round multiple of `sequence_state_dim`, got"""
													    F""" {self.sequence_state_dim} and {self.sequence_state_dim}."""						)
							if self.pairwise_state_dim % self.pairwise_state_dim != 0:
													raise ValueError(
													    """`pairwise_state_dim` should be a round multiple of `pairwise_state_dim`, got"""
													    F""" {self.pairwise_state_dim} and {self.pairwise_state_dim}."""						)

							lowercase        =							self.sequence_state_dim // self.sequence_head_width
							lowercase        =							self.pairwise_state_dim // self.pairwise_head_width

							if self.sequence_state_dim != sequence_num_heads * self.sequence_head_width:
													raise ValueError(
													    """`sequence_state_dim` should be equal to `sequence_num_heads * sequence_head_width, got"""
													    F""" {self.sequence_state_dim} != {sequence_num_heads} * {self.sequence_head_width}."""						)
							if self.pairwise_state_dim != pairwise_num_heads * self.pairwise_head_width:
													raise ValueError(
													    """`pairwise_state_dim` should be equal to `pairwise_num_heads * pairwise_head_width, got"""
													    F""" {self.pairwise_state_dim} != {pairwise_num_heads} * {self.pairwise_head_width}."""						)
							if self.pairwise_state_dim % 2 != 0:
													raise ValueError(F"""`pairwise_state_dim` should be even, got {self.pairwise_state_dim}."""						)

							if self.dropout >= 0.4:
													raise ValueError(F"""`dropout` should not be greater than 0.4, got {self.dropout}."""						)







	def   _a   (    self						)    ->    int:
							'''simple docstring'''






							lowercase        =							asdict(self						)
							lowercase        =							self.structure_module.to_dict()
							return output




@dataclass
class      __UpperCamelCase       :
	__A			  =					384
	__A			  =					128
	__A			  =					16
	__A			  =					128
	__A			  =					12
	__A			  =					4
	__A			  =					8
	__A			  =					0.1
	__A			  =					8
	__A			  =					1
	__A			  =					2
	__A			  =					7
	__A			  =					10
	__A			  =					1e-8
	__A			  =					1e5







	def   _a   (    self						)    ->    Optional[int]:
							'''simple docstring'''






							return asdict(self						)







def      SCREAMING_SNAKE_CASE				(				):
						return (
						    "<cls>",
						    "<pad>",
						    "<eos>",
						    "<unk>",
						    "L",
						    "A",
						    "G",
						    "V",
						    "S",
						    "E",
						    "R",
						    "T",
						    "I",
						    "D",
						    "P",
						    "K",
						    "Q",
						    "N",
						    "F",
						    "Y",
						    "M",
						    "H",
						    "W",
						    "C",
						    "X",
						    "B",
						    "U",
						    "Z",
						    "O",
						    ".",
						    "-",
						    "<null_1>",
						    "<mask>",
						)







'''simple docstring'''


import requests







def      SCREAMING_SNAKE_CASE				(				lowercase_    :      str ,  lowercase_    :      str						):
						lowercase        =							{"""Content-Type""": """application/json"""}
						lowercase        =							requests.post(lowercase_ ,  json={"""text""": message_body} ,  headers=lowercase_						)
						if response.status_code != 200:
												lowercase        =							(
												    """Request to slack returned an error """
												    F"""{response.status_code}, the response is:\n{response.text}"""
												)
												raise ValueError(lowercase_						)


if __name__ == "__main__":
						# Set the slack url to the one provided by Slack when you create the webhook at
						# https://my.slack.com/services/new/incoming-webhook/
						send_slack_message('''<YOUR MESSAGE BODY>''', '''<SLACK CHANNEL URL>''')


