




'''simple docstring'''





from __future__ import annotations

import math







def 			_a   (		SCREAMING_SNAKE_CASE_							:       int  ):



					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(A__  ) + 1  )   ,   6  ):
										if number % i == 0 or number % (i + 2) == 0:
															return False
					return True







def 			_a   (		SCREAMING_SNAKE_CASE_							:       int  ):
					__lowerCAmelCase            = str(A__  )
					__lowerCAmelCase            = [n]
					for i in range(1   ,   len(A__  )  ):
										list_nums.append(int(str_num[i:]  )  )
										list_nums.append(int(str_num[:-i]  )  )
					return list_nums







def 			_a   (		SCREAMING_SNAKE_CASE_							:       int  ):



					if len(str(A__  )  ) > 3:
										if not is_prime(int(str(A__  )[-3:]  )  ) or not is_prime(int(str(A__  )[:3]  )  ):
															return False
					return True







def 			_a   (		SCREAMING_SNAKE_CASE_							:       int = 11  ):
					__lowerCAmelCase            = []
					__lowerCAmelCase            = 13
					while len(A__  ) != count:
										if validate(A__  ):
															__lowerCAmelCase            = list_truncated_nums(A__  )
															if all(is_prime(A__  ) for i in list_nums  ):
																				list_truncated_primes.append(A__  )
										num += 2
					return list_truncated_primes







def 			_a   (		):
					return sum(compute_truncated_primes(11  )  )


if __name__ == "__main__":
					print(f'''{sum(compute_truncated_primes(11)) = }''')










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




