




'''simple docstring'''


import unittest
from dataclasses import dataclass
from typing import Optional

from transformers.utils import ModelOutput






@dataclass
class 						lowerCAmelCase_	(       UpperCAmelCase_							):







  '''simple docstring'''

  UpperCamelCase_			:      float
  UpperCamelCase_			:      Optional[float]										=				None
  UpperCamelCase_			:      Optional[float]										=				None






class 						lowerCAmelCase_	(       unittest.TestCase							):







  '''simple docstring'''

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







       '''simple docstring'''



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



  def 					_snake_case     ( self				:							str	)			->		Any:







       '''simple docstring'''



       A:		Optional[int]          =		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)	)

       A:		Union[str, 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 					_snake_case     ( self				:							List[Any]	)			->		Any:







       '''simple docstring'''



       A:		int          =		ModelOutputTest(a=30					,  b=10	)
       self.assertEqual(x['''a''']					,  30	)
       self.assertEqual(x['''b''']					,  10	)
       with self.assertRaises(SCREAMING_SNAKE_CASE_	):
            A:		Dict          =		x['''c''']

       A:		Union[str, Any]          =		ModelOutputTest(a=30					,  c=10	)
       self.assertEqual(x['''a''']					,  30	)
       self.assertEqual(x['''c''']					,  10	)
       with self.assertRaises(SCREAMING_SNAKE_CASE_	):
            A:		List[str]          =		x['''b''']



  def 					_snake_case     ( self				:							Optional[int]	)			->		Tuple:







       '''simple docstring'''



       A:		Optional[Any]          =		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(SCREAMING_SNAKE_CASE_	)					,  ['''a''']	)

       A:		Any          =		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(SCREAMING_SNAKE_CASE_	)					,  ['''a''', '''b''']	)

       A:		str          =		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(SCREAMING_SNAKE_CASE_	)					,  ['''a''', '''c''']	)

       with self.assertRaises(SCREAMING_SNAKE_CASE_	):
            A:		int          =		x.update({'''d''': 20}	)
       with self.assertRaises(SCREAMING_SNAKE_CASE_	):
            del x["a"]
       with self.assertRaises(SCREAMING_SNAKE_CASE_	):
            A:		str          =		x.pop('''a'''	)
       with self.assertRaises(SCREAMING_SNAKE_CASE_	):
            A:		Dict          =		x.setdefault('''d'''					,  32	)



  def 					_snake_case     ( self				:							Dict	)			->		Union[str, Any]:







       '''simple docstring'''



       A:		str          =		ModelOutputTest(a=30	)
       A:		List[str]          =		10
       self.assertEqual(x.a					,  10	)
       self.assertEqual(x['''a''']					,  10	)



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







       '''simple docstring'''



       A:		Optional[Any]          =		ModelOutputTest(a=30	)
       A:		str          =		10
       self.assertEqual(x.a					,  10	)
       self.assertEqual(x['''a''']					,  10	)



  def 					_snake_case     ( self				:							Any	)			->		str:







       '''simple docstring'''



       A:		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 					_snake_case     ( self				:							List[str]	)			->		List[Any]:







       '''simple docstring'''



       A:		List[Any]          =		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(SCREAMING_SNAKE_CASE_	):
            A:		Optional[int]          =		ModelOutputTest([('''a''', 30), (10, 10)]	)

       A:		Union[str, Any]          =		ModelOutputTest(a=(30, 30)	)
       self.assertEqual(list(x.keys()	)					,  ['''a''']	)
       self.assertEqual(x.a					,  (30, 30)	)












'''simple docstring'''


def 					SCREAMING_SNAKE_CASE(   __lowercase	)			-> int:
     if not isinstance(__lowercase		,				__lowercase	):
          raise ValueError('''double_factorial() only accepts integral values'''	)
     if n < 0:
          raise ValueError('''double_factorial() not defined for negative values'''	)
     return 1 if n <= 1 else n * double_factorial(n - 2	)


if __name__ == "__main__":
     import doctest

     doctest.testmod()






