


import unittest
from dataclasses import dataclass
from typing import Optional

from transformers.utils import ModelOutput







@dataclass
class    lowerCamelCase__     ( lowerCAmelCase):
     SCREAMING_SNAKE_CASE__       =    42
     SCREAMING_SNAKE_CASE__       =    None
     SCREAMING_SNAKE_CASE__       =    None







class    lowerCamelCase__     ( unittest.TestCase):





     def   __A      (self )  ->     Optional[int]:
      _lowercase							   =ModelOutputTest(a=3_0 )
      self.assertEqual(x.a	,  3_0 )
      self.assertIsNone(x.b )
      self.assertIsNone(x.c )
      with self.assertRaises(UpperCAmelCase ):
       _lowercase							   =x.d





     def   __A      (self )  ->     Dict:
      _lowercase							   =ModelOutputTest(a=3_0	,  b=1_0 )
      self.assertEqual(x[0]	,  3_0 )
      self.assertEqual(x[1]	,  1_0 )
      self.assertEqual(x[:2]	,  (3_0, 1_0) )
      self.assertEqual(x[:]	,  (3_0, 1_0) )

      _lowercase							   =ModelOutputTest(a=3_0	,  c=1_0 )
      self.assertEqual(x[0]	,  3_0 )
      self.assertEqual(x[1]	,  1_0 )
      self.assertEqual(x[:2]	,  (3_0, 1_0) )
      self.assertEqual(x[:]	,  (3_0, 1_0) )





     def   __A      (self )  ->     Optional[Any]:
      _lowercase							   =ModelOutputTest(a=3_0	,  b=1_0 )
      self.assertEqual(x['''a''']	,  3_0 )
      self.assertEqual(x['''b''']	,  1_0 )
      with self.assertRaises(UpperCAmelCase ):
       _lowercase							   =x['''c''']

      _lowercase							   =ModelOutputTest(a=3_0	,  c=1_0 )
      self.assertEqual(x['''a''']	,  3_0 )
      self.assertEqual(x['''c''']	,  1_0 )
      with self.assertRaises(UpperCAmelCase ):
       _lowercase							   =x['''b''']





     def   __A      (self )  ->     Optional[int]:
      _lowercase							   =ModelOutputTest(a=3_0 )
      self.assertEqual(list(x.keys() )	,  ['''a'''] )
      self.assertEqual(list(x.values() )	,  [3_0] )
      self.assertEqual(list(x.items() )	,  [('''a''', 3_0)] )
      self.assertEqual(list(UpperCAmelCase )	,  ['''a'''] )

      _lowercase							   =ModelOutputTest(a=3_0	,  b=1_0 )
      self.assertEqual(list(x.keys() )	,  ['''a''', '''b'''] )
      self.assertEqual(list(x.values() )	,  [3_0, 1_0] )
      self.assertEqual(list(x.items() )	,  [('''a''', 3_0), ('''b''', 1_0)] )
      self.assertEqual(list(UpperCAmelCase )	,  ['''a''', '''b'''] )

      _lowercase							   =ModelOutputTest(a=3_0	,  c=1_0 )
      self.assertEqual(list(x.keys() )	,  ['''a''', '''c'''] )
      self.assertEqual(list(x.values() )	,  [3_0, 1_0] )
      self.assertEqual(list(x.items() )	,  [('''a''', 3_0), ('''c''', 1_0)] )
      self.assertEqual(list(UpperCAmelCase )	,  ['''a''', '''c'''] )

      with self.assertRaises(UpperCAmelCase ):
       _lowercase							   =x.update({'''d''': 2_0} )
      with self.assertRaises(UpperCAmelCase ):
       del x["a"]
      with self.assertRaises(UpperCAmelCase ):
       _lowercase							   =x.pop('''a''' )
      with self.assertRaises(UpperCAmelCase ):
       _lowercase							   =x.setdefault('''d'''	,  3_2 )





     def   __A      (self )  ->     List[Any]:
      _lowercase							   =ModelOutputTest(a=3_0 )
      _lowercase							   =1_0
      self.assertEqual(x.a	,  1_0 )
      self.assertEqual(x['''a''']	,  1_0 )





     def   __A      (self )  ->     str:
      _lowercase							   =ModelOutputTest(a=3_0 )
      _lowercase							   =1_0
      self.assertEqual(x.a	,  1_0 )
      self.assertEqual(x['''a''']	,  1_0 )





     def   __A      (self )  ->     List[Any]:
      _lowercase							   =ModelOutputTest({'''a''': 3_0, '''b''': 1_0} )
      self.assertEqual(list(x.keys() )	,  ['''a''', '''b'''] )
      self.assertEqual(x.a	,  3_0 )
      self.assertEqual(x.b	,  1_0 )





     def   __A      (self )  ->     Optional[Any]:
      _lowercase							   =ModelOutputTest([('''a''', 3_0), ('''b''', 1_0)] )
      self.assertEqual(list(x.keys() )	,  ['''a''', '''b'''] )
      self.assertEqual(x.a	,  3_0 )
      self.assertEqual(x.b	,  1_0 )

      with self.assertRaises(UpperCAmelCase ):
       _lowercase							   =ModelOutputTest([('''a''', 3_0), (1_0, 1_0)] )

      _lowercase							   =ModelOutputTest(a=(3_0, 3_0) )
      self.assertEqual(list(x.keys() )	,  ['''a'''] )
      self.assertEqual(x.a	,  (3_0, 3_0) )





def        UpperCAmelCase_      (							__snake_case		)  ->    bool:







 """simple docstring"""


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


if __name__ == "__main__":
  import doctest

  doctest.testmod()

