


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     A__   (       unittest.TestCase      ):







    """simple docstring"""

    @slow
    def 						a_     (			self       ):
         snake_case											=							FlaxXLMRobertaModel.from_pretrained('''xlm-roberta-base'''       )
         snake_case											=							AutoTokenizer.from_pretrained('''xlm-roberta-base'''       )
         snake_case											=							'''The dog is cute and lives in the garden house'''
         snake_case											=							jnp.array([tokenizer.encode(__snake_case       )]       )

         snake_case											=							(1, 1_2, 7_6_8)  # batch_size, sequence_length, embedding_vector_dim
         snake_case											=							jnp.array(
             [[-0.0101, 0.1218, -0.0803, 0.0801, 0.1327, 0.0776, -0.1215, 0.2383, 0.3338, 0.3106, 0.0300, 0.0252]]       )

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








import requests

_SCREAMING_SNAKE_CASE     :					Optional[int]      =       ""  # <-- Put your OpenWeatherMap appid here!
_SCREAMING_SNAKE_CASE     :					Optional[Any]      =       "https://api.openweathermap.org/data/2.5/"
def      UpperCAmelCase__		(UpperCamelCase_ = "Chicago"				,UpperCamelCase_ = APPID							):



     """simple docstring"""






     return requests.get(URL_BASE + '''weather'''				,params=locals()							).json()
def      UpperCAmelCase__		(UpperCamelCase_ = "Kolkata, India"				,UpperCamelCase_ = APPID							):



     """simple docstring"""






     return requests.get(URL_BASE + '''forecast'''				,params=locals()							).json()
def      UpperCAmelCase__		(UpperCamelCase_ = 55.68				,UpperCamelCase_ = 12.57				,UpperCamelCase_ = APPID							):



     """simple docstring"""






     return requests.get(URL_BASE + '''onecall'''				,params=locals()							).json()


if __name__ == "__main__":
 from pprint import pprint

 while True:
  _SCREAMING_SNAKE_CASE     :					Any      =       input("Enter a location:").strip()
  if location:
   pprint(current_weather(location))
  else:
   break




