





import unittest

from transformers import AutoTokenizer, is_flax_available
from transformers.testing_utils import require_flax, require_sentencepiece, require_tokenizers, slow


if is_flax_available():
       import jax.numpy as jnp

       from transformers import FlaxXLMRobertaModel


@require_sentencepiece
@require_tokenizers
@require_flax
class        __SCREAMING_SNAKE_CASE      (			unittest.TestCase ):







       @slow
       def 						__lowerCamelCase   (				self					:     Any      )       ->List[str]:
          lowerCamelCase__       :						List[str]        =							FlaxXLMRobertaModel.from_pretrained('''xlm-roberta-base'''      )
          lowerCamelCase__       :						Any        =							AutoTokenizer.from_pretrained('''xlm-roberta-base'''      )
          lowerCamelCase__       :						str        =							'''The dog is cute and lives in the garden house'''
          lowerCamelCase__       :						List[str]        =							jnp.array([tokenizer.encode(A      )]      )

          lowerCamelCase__       :						Dict        =							(1, 1_2, 7_6_8)  # batch_size, sequence_length, embedding_vector_dim
          lowerCamelCase__       :						Optional[int]        =							jnp.array(
              [[-0.01_01, 0.12_18, -0.08_03, 0.08_01, 0.13_27, 0.07_76, -0.12_15, 0.23_83, 0.33_38, 0.31_06, 0.03_00, 0.02_52]]      )

          lowerCamelCase__       :						str        =							model(A      )['''last_hidden_state''']
          self.assertEqual(output.shape		, A      )
          # compare the actual values for a slice of last dim
          self.assertTrue(jnp.allclose(output[:, :, -1]		, A		, atol=1e-3      )      )










def 	_a						(   UpperCAmelCase					)    ->    bool:







   """simple docstring"""
   return str(UpperCAmelCase					) == str(UpperCAmelCase					)[::-1]



def 	_a						(   UpperCAmelCase					)    ->    int:







   """simple docstring"""
   return int(UpperCAmelCase					) + int(str(UpperCAmelCase					)[::-1]					)



def 	_a						(   UpperCAmelCase = 10000					)    ->    int:







   """simple docstring"""
   lowerCamelCase__       :						Tuple        =							[]
   for num in range(1      ,  UpperCAmelCase					):
      lowerCamelCase__       :						List[str]        =							0
      lowerCamelCase__       :						Union[str, Any]        =							num
      while iterations < 50:
         lowerCamelCase__       :						Dict        =							sum_reverse(UpperCAmelCase					)
         iterations += 1
         if is_palindrome(UpperCAmelCase					):
            break
      else:
         lychrel_nums.append(UpperCAmelCase					)
   return len(UpperCAmelCase					)


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



