




import random
class     a__					:






						@staticmethod
						def        __SCREAMING_SNAKE_CASE(     _A    ):




											"""simple docstring"""



											__lowerCAmelCase            = [ord(_A    ) for i in text]
											__lowerCAmelCase            = []
											__lowerCAmelCase            = []
											for i in plain:
																__lowerCAmelCase            = random.randint(1	,    3_0_0    )
																__lowerCAmelCase            = (i + k) * k
																cipher.append(_A    )
																key.append(_A    )
											return cipher, key






						@staticmethod
						def        __SCREAMING_SNAKE_CASE(     _A	,    _A    ):




											"""simple docstring"""



											__lowerCAmelCase            = []
											for i in range(len(_A    )    ):
																__lowerCAmelCase            = int((cipher[i] - (key[i]) ** 2) / key[i]    )
																plain.append(chr(_A    )    )
											return "".join(_A    )


if __name__ == "__main__":
					UpperCamelCase__    ,			UpperCamelCase__					    =    Onepad().encrypt("""Hello""")
					print(c, k)
					print(Onepad().decrypt(c, k))










import torch
from transformers import PreTrainedModel, XLMRobertaConfig, XLMRobertaModel
class     a__					(      snake_case__   ):
						_a							:					Optional[Any]      =					"""M-CLIP"""






						def __init__(     self	,    _A=1_0_2_4	,    _A=7_6_8	,    **_A    ):




											"""simple docstring"""



											__lowerCAmelCase            = transformerDimSize
											__lowerCAmelCase            = imageDimSize
											super().__init__(**_A    )






class     a__					(      snake_case__   ):
						_a							:					Tuple      =					MCLIPConfig






						def __init__(     self	,    _A	,    *_A	,    **_A    ):




											"""simple docstring"""



											super().__init__(_A	,    *_A	,    **_A    )
											__lowerCAmelCase            = XLMRobertaModel(_A    )
											__lowerCAmelCase            = torch.nn.Linear(
											    in_features=config.transformerDimensions	,    out_features=config.numDims    )






						def        __SCREAMING_SNAKE_CASE(     self	,    _A	,    _A    ):




											"""simple docstring"""



											__lowerCAmelCase            = self.transformer(input_ids=_A	,    attention_mask=_A    )[0]
											__lowerCAmelCase            = (embs * attention_mask.unsqueeze(2    )).sum(dim=1    ) / attention_mask.sum(dim=1    )[:, None]
											return self.LinearTransformation(_A    ), embs




