



"""simple docstring"""


import unittest
from dataclasses import dataclass
from typing import Optional

from transformers.utils import ModelOutput







@dataclass
class  A_     (	SCREAMING_SNAKE_CASE_							):



						"""simple docstring"""
						__UpperCamelCase													=				42
						__UpperCamelCase													=				None
						__UpperCamelCase													=				None







class  A_     (	unittest.TestCase							):



						"""simple docstring"""






						def       UpperCAmelCase__	(   self					:Union[str, Any]   )							->     List[Any]:
												UpperCAmelCase			 =					ModelOutputTest(a=30   )
												self.assertEqual(x.a  ,    30   )
												self.assertIsNone(x.b   )
												self.assertIsNone(x.c   )
												with self.assertRaises(lowercase_   ):
																		UpperCAmelCase			 =					x.d






						def       UpperCAmelCase__	(   self					:List[str]   )							->     Any:
												UpperCAmelCase			 =					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			 =					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       UpperCAmelCase__	(   self					:Dict   )							->     int:
												UpperCAmelCase			 =					ModelOutputTest(a=30  ,    b=10   )
												self.assertEqual(x['a']  ,    30   )
												self.assertEqual(x['b']  ,    10   )
												with self.assertRaises(lowercase_   ):
																		UpperCAmelCase			 =					x['c']

												UpperCAmelCase			 =					ModelOutputTest(a=30  ,    c=10   )
												self.assertEqual(x['a']  ,    30   )
												self.assertEqual(x['c']  ,    10   )
												with self.assertRaises(lowercase_   ):
																		UpperCAmelCase			 =					x['b']






						def       UpperCAmelCase__	(   self					:List[Any]   )							->     Union[str, Any]:
												UpperCAmelCase			 =					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(lowercase_   )  ,    ['a']   )

												UpperCAmelCase			 =					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(lowercase_   )  ,    ['a', 'b']   )

												UpperCAmelCase			 =					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(lowercase_   )  ,    ['a', 'c']   )

												with self.assertRaises(lowercase_   ):
																		UpperCAmelCase			 =					x.update({'d': 20}   )
												with self.assertRaises(lowercase_   ):
																		del x["a"]
												with self.assertRaises(lowercase_   ):
																		UpperCAmelCase			 =					x.pop('a'   )
												with self.assertRaises(lowercase_   ):
																		UpperCAmelCase			 =					x.setdefault('d'  ,    32   )






						def       UpperCAmelCase__	(   self					:Any   )							->     Union[str, Any]:
												UpperCAmelCase			 =					ModelOutputTest(a=30   )
												UpperCAmelCase			 =					10
												self.assertEqual(x.a  ,    10   )
												self.assertEqual(x['a']  ,    10   )






						def       UpperCAmelCase__	(   self					:Any   )							->     int:
												UpperCAmelCase			 =					ModelOutputTest(a=30   )
												UpperCAmelCase			 =					10
												self.assertEqual(x.a  ,    10   )
												self.assertEqual(x['a']  ,    10   )






						def       UpperCAmelCase__	(   self					:Union[str, Any]   )							->     List[str]:
												UpperCAmelCase			 =					ModelOutputTest({'a': 30, 'b': 10}   )
												self.assertEqual(list(x.keys()   )  ,    ['a', 'b']   )
												self.assertEqual(x.a  ,    30   )
												self.assertEqual(x.b  ,    10   )






						def       UpperCAmelCase__	(   self					:List[str]   )							->     Optional[int]:
												UpperCAmelCase			 =					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(lowercase_   ):
																		UpperCAmelCase			 =					ModelOutputTest([('a', 30), (10, 10)]   )

												UpperCAmelCase			 =					ModelOutputTest(a=(30, 30)   )
												self.assertEqual(list(x.keys()   )  ,    ['a']   )
												self.assertEqual(x.a  ,    (30, 30)   )












def        __SCREAMING_SNAKE_CASE	(				__lowercase:		int):



  '''simple docstring'''






  if not isinstance(__lowercase  ,				__lowercase):
    __lowerCAmelCase								=					F'''Input value of [number={number}] must be an integer'''
    raise TypeError(__lowercase)
  if number < 0 or number % 2 == 1:
    return False
  __lowerCAmelCase								=					int(number**0.5)
  return number == number_sqrt * (number_sqrt + 1)


if __name__ == "__main__":
      import doctest

      doctest.testmod()
