

import unittest
from dataclasses import dataclass
from typing import Optional

from transformers.utils import ModelOutput

@dataclass
class      _a				( snake_case_							):




      """simple docstring"""

      _lowerCamelCase					: float
      _lowerCamelCase					: Optional[float]					=					None
      _lowerCamelCase					: Optional[float]					=					None




class      _a				( unittest.TestCase							):




      """simple docstring"""

      def 		__A  (      self       :							int  ):
            A_	     =							ModelOutputTest(a=30  )
            self.assertEqual(x.a	, 30  )
            self.assertIsNone(x.b  )
            self.assertIsNone(x.c  )
            with self.assertRaises(UpperCAmelCase  ):
                  A_	     =							x.d





      def 		__A  (      self       :							Dict  ):
            A_	     =							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_	     =							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 		__A  (      self       :							Dict  ):
            A_	     =							ModelOutputTest(a=30	, b=10  )
            self.assertEqual(x["a"]	, 30  )
            self.assertEqual(x["b"]	, 10  )
            with self.assertRaises(UpperCAmelCase  ):
                  A_	     =							x["c"]

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





      def 		__A  (      self       :							Union[str, Any]  ):
            A_	     =							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(UpperCAmelCase  )	, ["a"]  )

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

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

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





      def 		__A  (      self       :							Optional[int]  ):
            A_	     =							ModelOutputTest(a=30  )
            A_	     =							10
            self.assertEqual(x.a	, 10  )
            self.assertEqual(x["a"]	, 10  )





      def 		__A  (      self       :							Tuple  ):
            A_	     =							ModelOutputTest(a=30  )
            A_	     =							10
            self.assertEqual(x.a	, 10  )
            self.assertEqual(x["a"]	, 10  )





      def 		__A  (      self       :							Optional[int]  ):
            A_	     =							ModelOutputTest({"a": 30, "b": 10}  )
            self.assertEqual(list(x.keys()  )	, ["a", "b"]  )
            self.assertEqual(x.a	, 30  )
            self.assertEqual(x.b	, 10  )







      def 		__A  (      self       :							Tuple  ):
            A_	     =							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(UpperCAmelCase  ):
                  A_	     =							ModelOutputTest([("a", 30), (10, 10)]  )

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









__a						:Dict            = {hex(i)[2:]: i for i in range(16)}  # Use [:2] to strip off the leading '0x'

def 			__snake_case	(   __UpperCamelCase  :   str						):



      """simple docstring"""

      A_	     =							hex_string.strip().lower()
      if not hex_string:
            raise ValueError("Empty string was passed to the function"						)
      A_	     =							hex_string[0] == "-"
      if is_negative:
            A_	     =							hex_string[1:]
      if not all(char in hex_table for char in hex_string						):
            raise ValueError("Non-hexadecimal value was passed to the function"						)
      A_	     =							0
      for char in hex_string:
            A_	     =							16 * decimal_number + hex_table[char]
      return -decimal_number if is_negative else decimal_number


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

      testmod()