


'''simple docstring'''


import unittest
from dataclasses import dataclass
from typing import Optional

from transformers.utils import ModelOutput






@dataclass
class 						lowerCAmelCase__      (      UpperCAmelCase__						):
			lowerCAmelCase			:						float
			lowerCAmelCase			:						Optional[float]							 =  None
			lowerCAmelCase			:						Optional[float]							 =  None






class 						lowerCAmelCase__      (      unittest.TestCase						):




			def 				lowerCAmelCase__     (		self	:  List[Any]			) ->Optional[int]:



					'''simple docstring'''







					_UpperCAmelCase		:							Dict             =   ModelOutputTest(a=30			)
					self.assertEqual(x.a						,	30			)
					self.assertIsNone(x.b			)
					self.assertIsNone(x.c			)
					with self.assertRaises(lowerCamelCase__			):
							_UpperCAmelCase		:							int             =   x.d




			def 				lowerCAmelCase__     (		self	:  str			) ->Optional[int]:



					'''simple docstring'''







					_UpperCAmelCase		:							Tuple             =   ModelOutputTest(a=30						,	b=10			)
					self.assertEqual(x[0]						,	30			)
					self.assertEqual(x[1]						,	10			)
					self.assertEqual(x[:2]						,	(30, 10)			)
					self.assertEqual(x[:]						,	(30, 10)			)

					_UpperCAmelCase		:							Optional[Any]             =   ModelOutputTest(a=30						,	c=10			)
					self.assertEqual(x[0]						,	30			)
					self.assertEqual(x[1]						,	10			)
					self.assertEqual(x[:2]						,	(30, 10)			)
					self.assertEqual(x[:]						,	(30, 10)			)




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



					'''simple docstring'''







					_UpperCAmelCase		:							Tuple             =   ModelOutputTest(a=30						,	b=10			)
					self.assertEqual(x["a"]						,	30			)
					self.assertEqual(x["b"]						,	10			)
					with self.assertRaises(lowerCamelCase__			):
							_UpperCAmelCase		:							Any             =   x["c"]

					_UpperCAmelCase		:							Dict             =   ModelOutputTest(a=30						,	c=10			)
					self.assertEqual(x["a"]						,	30			)
					self.assertEqual(x["c"]						,	10			)
					with self.assertRaises(lowerCamelCase__			):
							_UpperCAmelCase		:							Any             =   x["b"]




			def 				lowerCAmelCase__     (		self	:  Union[str, Any]			) ->int:



					'''simple docstring'''







					_UpperCAmelCase		:							str             =   ModelOutputTest(a=30			)
					self.assertEqual(list(x.keys()			)						,	["a"]			)
					self.assertEqual(list(x.values()			)						,	[30]			)
					self.assertEqual(list(x.items()			)						,	[("a", 30)]			)
					self.assertEqual(list(lowerCamelCase__			)						,	["a"]			)

					_UpperCAmelCase		:							int             =   ModelOutputTest(a=30						,	b=10			)
					self.assertEqual(list(x.keys()			)						,	["a", "b"]			)
					self.assertEqual(list(x.values()			)						,	[30, 10]			)
					self.assertEqual(list(x.items()			)						,	[("a", 30), ("b", 10)]			)
					self.assertEqual(list(lowerCamelCase__			)						,	["a", "b"]			)

					_UpperCAmelCase		:							Dict             =   ModelOutputTest(a=30						,	c=10			)
					self.assertEqual(list(x.keys()			)						,	["a", "c"]			)
					self.assertEqual(list(x.values()			)						,	[30, 10]			)
					self.assertEqual(list(x.items()			)						,	[("a", 30), ("c", 10)]			)
					self.assertEqual(list(lowerCamelCase__			)						,	["a", "c"]			)

					with self.assertRaises(lowerCamelCase__			):
							_UpperCAmelCase		:							Union[str, Any]             =   x.update({"d": 20}			)
					with self.assertRaises(lowerCamelCase__			):
							del x["a"]
					with self.assertRaises(lowerCamelCase__			):
							_UpperCAmelCase		:							List[Any]             =   x.pop("a"			)
					with self.assertRaises(lowerCamelCase__			):
							_UpperCAmelCase		:							List[Any]             =   x.setdefault("d"						,	32			)




			def 				lowerCAmelCase__     (		self	:  Optional[Any]			) ->Tuple:



					'''simple docstring'''







					_UpperCAmelCase		:							Optional[int]             =   ModelOutputTest(a=30			)
					_UpperCAmelCase		:							List[str]             =   10
					self.assertEqual(x.a						,	10			)
					self.assertEqual(x["a"]						,	10			)




			def 				lowerCAmelCase__     (		self	:  Dict			) ->Optional[int]:



					'''simple docstring'''







					_UpperCAmelCase		:							Optional[Any]             =   ModelOutputTest(a=30			)
					_UpperCAmelCase		:							List[str]             =   10
					self.assertEqual(x.a						,	10			)
					self.assertEqual(x["a"]						,	10			)




			def 				lowerCAmelCase__     (		self	:  Union[str, Any]			) ->Optional[Any]:



					'''simple docstring'''







					_UpperCAmelCase		:							Union[str, Any]             =   ModelOutputTest({"a": 30, "b": 10}			)
					self.assertEqual(list(x.keys()			)						,	["a", "b"]			)
					self.assertEqual(x.a						,	30			)
					self.assertEqual(x.b						,	10			)






			def 				lowerCAmelCase__     (		self	:  Optional[Any]			) ->Optional[int]:



					'''simple docstring'''







					_UpperCAmelCase		:							int             =   ModelOutputTest([("a", 30), ("b", 10)]			)
					self.assertEqual(list(x.keys()			)						,	["a", "b"]			)
					self.assertEqual(x.a						,	30			)
					self.assertEqual(x.b						,	10			)

					with self.assertRaises(lowerCamelCase__			):
							_UpperCAmelCase		:							Optional[Any]             =   ModelOutputTest([("a", 30), (10, 10)]			)

					_UpperCAmelCase		:							str             =   ModelOutputTest(a=(30, 30)			)
					self.assertEqual(list(x.keys()			)						,	["a"]			)
					self.assertEqual(x.a						,	(30, 30)			)







'''simple docstring'''


def 			__lowerCAmelCase			(__lowerCAmelCase ):
		return "".join(chr(ord(__lowerCAmelCase ) + 32 ) if "A" <= char <= "Z" else char for char in word )


if __name__ == "__main__":
						from doctest import testmod

						testmod()



