



'''simple docstring'''
import unittest
from dataclasses import dataclass
from typing import Optional

from transformers.utils import ModelOutput


@dataclass
class   SCREAMING_SNAKE_CASE__				(   a_					):
 """simple docstring"""


 A__    :    float
 A__    :    Optional[float]						=				None
 A__    :    Optional[float]						=				None







class   SCREAMING_SNAKE_CASE__				(   unittest.TestCase					):
 """simple docstring"""


 def      a__ (		self			) ->							Union[str, Any]:
    A:      int														=   ModelOutputTest(a=30			)
    self.assertEqual(x.a					,   30			)
    self.assertIsNone(x.b			)
    self.assertIsNone(x.c			)
    with self.assertRaises(_snake_case			):
       A:      Any														=   x.d


 def      a__ (		self			) ->							Tuple:
    A:      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:      Tuple														=   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			) ->							List[str]:
    A:      Union[str, Any]														=   ModelOutputTest(a=30					,   b=10			)
    self.assertEqual(x["""a"""]					,   30			)
    self.assertEqual(x["""b"""]					,   10			)
    with self.assertRaises(_snake_case			):
       A:      Union[str, Any]														=   x['''c''']

    A:      Optional[Any]														=   ModelOutputTest(a=30					,   c=10			)
    self.assertEqual(x["""a"""]					,   30			)
    self.assertEqual(x["""c"""]					,   10			)
    with self.assertRaises(_snake_case			):
       A:      Dict														=   x['''b''']


 def      a__ (		self			) ->							List[Any]:
    A:      Dict														=   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(_snake_case			)					,   ["""a"""]			)

    A:      Optional[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(_snake_case			)					,   ["""a""", """b"""]			)

    A:      int														=   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(_snake_case			)					,   ["""a""", """c"""]			)

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


 def      a__ (		self			) ->							int:
    A:      List[Any]														=   ModelOutputTest(a=30			)
    A:      List[Any]														=   10
    self.assertEqual(x.a					,   10			)
    self.assertEqual(x["""a"""]					,   10			)


 def      a__ (		self			) ->							Union[str, Any]:
    A:      str														=   ModelOutputTest(a=30			)
    A:      int														=   10
    self.assertEqual(x.a					,   10			)
    self.assertEqual(x["""a"""]					,   10			)


 def      a__ (		self			) ->							Any:
    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			)





 def      a__ (		self			) ->							int:
    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(_snake_case			):
       A:      List[Any]														=   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'''
from ..utils import DummyObject, requires_backends


class   SCREAMING_SNAKE_CASE__				(   metaclass=snake_case_					):
	"""simple docstring"""


	A__    :    Optional[int]						=				['''torch''', '''transformers''', '''invisible_watermark''']


	def __init__(		self					,   *A					,   **A			) ->							Tuple:
				requires_backends(self					,   ["""torch""", """transformers""", """invisible_watermark"""]			)


	@classmethod
	def      a__ (		cls					,   *A					,   **A			) ->							Optional[int]:
				requires_backends(cls					,   ["""torch""", """transformers""", """invisible_watermark"""]			)





	@classmethod
	def      a__ (		cls					,   *A					,   **A			) ->							List[Any]:
				requires_backends(cls					,   ["""torch""", """transformers""", """invisible_watermark"""]			)







class   SCREAMING_SNAKE_CASE__				(   metaclass=snake_case_					):
	"""simple docstring"""


	A__    :    Optional[int]						=				['''torch''', '''transformers''', '''invisible_watermark''']


	def __init__(		self					,   *A					,   **A			) ->							List[str]:
				requires_backends(self					,   ["""torch""", """transformers""", """invisible_watermark"""]			)


	@classmethod
	def      a__ (		cls					,   *A					,   **A			) ->							Union[str, Any]:
				requires_backends(cls					,   ["""torch""", """transformers""", """invisible_watermark"""]			)





	@classmethod
	def      a__ (		cls					,   *A					,   **A			) ->							Union[str, Any]:
				requires_backends(cls					,   ["""torch""", """transformers""", """invisible_watermark"""]			)





