




'''simple docstring'''





def   UpperCamelCase_(			snake_case							: int = 9_9_8_0_0_1  ):

							'''simple docstring'''






							for number in range(n - 1							,       9_9_9_9							,       -1  ):
														snake_case_			      =   str(snake_case  )

														# checks whether 'str_number' is a palindrome.
														if str_number == str_number[::-1]:
																					snake_case_			      =   9_9_9

																					# if 'number' is a product of two 3-digit numbers
																					# then number is the answer otherwise fetch next number.
																					while divisor != 9_9:
																												if (number % divisor == 0) and (len(str(number // divisor  )  ) == 3.0):
																																			return number
																												divisor -= 1
							raise ValueError("That number is larger than our acceptable range."  )


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










'''simple docstring'''





import unittest

from transformers import is_torch_available
from transformers.testing_utils import require_sentencepiece, require_tokenizers, require_torch, slow, torch_device


if is_torch_available():
		import torch

		from transformers import CamembertModel




@require_torch
@require_sentencepiece
@require_tokenizers
class 				_snake_case	(			unittest.TestCase							):




			@slow
			def      lowerCAmelCase__       (      self							)       ->       List[Any]:

										'''simple docstring'''




										snake_case_			      =   CamembertModel.from_pretrained("camembert-base"							)
										model.to(a__							)

										snake_case_			      =   torch.tensor(
										    [[5, 121, 11, 660, 16, 730, 25_543, 110, 83, 6]]       ,							device=a__       ,							dtype=torch.long       ,							)  # J'aime le camembert !
										with torch.no_grad():
																	snake_case_			      =   model(a__							)["last_hidden_state"]
										snake_case_			      =   torch.Size((1, 10, 768)							)
										self.assertEqual(output.shape       ,							a__							)
										# compare the actual values for a slice.
										snake_case_			      =   torch.tensor(
										    [[[-0.0_2_5_4, 0.0_2_3_5, 0.1_0_2_7], [0.0_6_0_6, -0.1_8_1_1, -0.0_4_1_8], [-0.1_5_6_1, -0.1_1_2_7, 0.2_6_8_7]]]       ,							device=a__       ,							dtype=torch.float       ,							)
										# camembert = torch.hub.load('pytorch/fairseq', 'camembert.v0')
										# camembert.eval()
										# expected_slice = roberta.model.forward(input_ids)[0][:, :3, :3].detach()

										self.assertTrue(torch.allclose(output[:, :3, :3]       ,							a__       ,							atol=1e-4							)							)




