




import requests

__SCREAMING_SNAKE_CASE 						=""""""  # <-- Put your OpenWeatherMap appid here!
__SCREAMING_SNAKE_CASE 						="""https://api.openweathermap.org/data/2.5/"""

def 			a   (_lowerCAmelCase = "Chicago"  ,    _lowerCAmelCase = APPID     ):
							return requests.get(URL_BASE + '''weather'''  ,    params=locals()     ).json()

def 			a   (_lowerCAmelCase = "Kolkata, India"  ,    _lowerCAmelCase = APPID     ):
							return requests.get(URL_BASE + '''forecast'''  ,    params=locals()     ).json()

def 			a   (_lowerCAmelCase = 55.68  ,    _lowerCAmelCase = 12.57  ,    _lowerCAmelCase = APPID     ):
							return requests.get(URL_BASE + '''onecall'''  ,    params=locals()     ).json()


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

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








import unittest

from transformers import is_torch_available
from transformers.testing_utils import require_torch


if is_torch_available():
			import torch

			from transformers.generation import DisjunctiveConstraint






@require_torch
class  __magic_name__						(  unittest.TestCase):
				'''simple docstring'''







				def     _A							(							self:   str		):
											# For consistency across different places the DisjunctiveConstraint is called,
											# dc.token_ids is a list of integers. It is also initialized only by integers.

											SCREAMING_SNAKE_CASE_   	=    [[1, 2, 4], [1, 2, 3, 4]]
											SCREAMING_SNAKE_CASE_   	=    DisjunctiveConstraint(_lowerCamelCase		)
											self.assertTrue(isinstance(dc.token_ids		,					_lowerCamelCase		)		)

											with self.assertRaises(_lowerCamelCase		):
																		DisjunctiveConstraint(torch.LongTensor([[1, 2, 4], [1, 2, 3]]		)		)

											with self.assertRaises(_lowerCamelCase		):
																		DisjunctiveConstraint([torch.LongTensor([1, 2, 4]		), torch.LongTensor([1, 2, 3, 4, 5]		)]		)


				def     _A							(							self:   Union[str, Any]		):
											# We can't have constraints that are complete subsets of another. This leads to a preverse
											# interpretation of "constraint fulfillment": does generating [1,2,3] fulfill the constraint?
											# It would mean that it generated [1,2] which fulfills it, but it's in the middle of potentially
											# fulfilling [1,2,3,4]. If we believe that [1,2,3] does fulfill the constraint, then the algorithm
											# will necessarily never reach [1,2,3,4], giving users a false sense of control (better to just not allow it).
											SCREAMING_SNAKE_CASE_   	=    [[1, 2], [1, 2, 3, 4]]

											with self.assertRaises(_lowerCamelCase		):
																		DisjunctiveConstraint(_lowerCamelCase		)  # fails here


				def     _A							(							self:   Dict		):
											SCREAMING_SNAKE_CASE_   	=    [[1, 2, 3], [1, 2, 4]]

											SCREAMING_SNAKE_CASE_   	=    DisjunctiveConstraint(_lowerCamelCase		)

											SCREAMING_SNAKE_CASE_	,	SCREAMING_SNAKE_CASE_	,	SCREAMING_SNAKE_CASE_   	=    dc.update(1		)
											SCREAMING_SNAKE_CASE_   	=    stepped is True and completed is False and reset is False
											self.assertTrue(_lowerCamelCase		)
											self.assertTrue(not dc.completed		)
											self.assertTrue(dc.current_seq == [1]		)

											SCREAMING_SNAKE_CASE_	,	SCREAMING_SNAKE_CASE_	,	SCREAMING_SNAKE_CASE_   	=    dc.update(2		)
											SCREAMING_SNAKE_CASE_   	=    stepped is True and completed is False and reset is False
											self.assertTrue(_lowerCamelCase		)
											self.assertTrue(not dc.completed		)
											self.assertTrue(dc.current_seq == [1, 2]		)

											SCREAMING_SNAKE_CASE_	,	SCREAMING_SNAKE_CASE_	,	SCREAMING_SNAKE_CASE_   	=    dc.update(3		)
											SCREAMING_SNAKE_CASE_   	=    stepped is True and completed is True and reset is False
											self.assertTrue(_lowerCamelCase		)
											self.assertTrue(dc.completed		)  # Completed!
											self.assertTrue(dc.current_seq == [1, 2, 3]		)





				def     _A							(							self:   Optional[int]		):
											SCREAMING_SNAKE_CASE_   	=    [[1, 2, 3], [1, 2, 4, 5], [1, 2, 5]]

											SCREAMING_SNAKE_CASE_   	=    DisjunctiveConstraint(_lowerCamelCase		)

											SCREAMING_SNAKE_CASE_	,	SCREAMING_SNAKE_CASE_	,	SCREAMING_SNAKE_CASE_   	=    dc.update(1		)
											self.assertTrue(not dc.completed		)
											self.assertTrue(dc.current_seq == [1]		)

											SCREAMING_SNAKE_CASE_	,	SCREAMING_SNAKE_CASE_	,	SCREAMING_SNAKE_CASE_   	=    dc.update(2		)
											self.assertTrue(not dc.completed		)
											self.assertTrue(dc.current_seq == [1, 2]		)

											SCREAMING_SNAKE_CASE_	,	SCREAMING_SNAKE_CASE_	,	SCREAMING_SNAKE_CASE_   	=    dc.update(4		)
											self.assertTrue(not dc.completed		)
											self.assertTrue(dc.current_seq == [1, 2, 4]		)

											SCREAMING_SNAKE_CASE_	,	SCREAMING_SNAKE_CASE_	,	SCREAMING_SNAKE_CASE_   	=    dc.update(5		)
											self.assertTrue(dc.completed		)  # Completed!
											self.assertTrue(dc.current_seq == [1, 2, 4, 5]		)

											dc.reset()

											SCREAMING_SNAKE_CASE_	,	SCREAMING_SNAKE_CASE_	,	SCREAMING_SNAKE_CASE_   	=    dc.update(1		)
											self.assertTrue(not dc.completed		)
											self.assertTrue(dc.remaining() == 3		)
											self.assertTrue(dc.current_seq == [1]		)

											SCREAMING_SNAKE_CASE_	,	SCREAMING_SNAKE_CASE_	,	SCREAMING_SNAKE_CASE_   	=    dc.update(2		)
											self.assertTrue(not dc.completed		)
											self.assertTrue(dc.remaining() == 2		)
											self.assertTrue(dc.current_seq == [1, 2]		)

											SCREAMING_SNAKE_CASE_	,	SCREAMING_SNAKE_CASE_	,	SCREAMING_SNAKE_CASE_   	=    dc.update(5		)
											self.assertTrue(dc.completed		)  # Completed!
											self.assertTrue(dc.remaining() == 0		)
											self.assertTrue(dc.current_seq == [1, 2, 5]		)


