



"""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)   )













from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


A_			:Union[str, Any]	    =		{'''configuration_nat''': ['''NAT_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''NatConfig''']}


try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							A_			:Optional[Any]	    =		[
							    '''NAT_PRETRAINED_MODEL_ARCHIVE_LIST''',
							    '''NatForImageClassification''',
							    '''NatModel''',
							    '''NatPreTrainedModel''',
							    '''NatBackbone''',
							]

if TYPE_CHECKING:
							from .configuration_nat import NAT_PRETRAINED_CONFIG_ARCHIVE_MAP, NatConfig

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_nat import (
														    NAT_PRETRAINED_MODEL_ARCHIVE_LIST,
														    NatBackbone,
														    NatForImageClassification,
														    NatModel,
														    NatPreTrainedModel,
														)

else:
							import sys

							A_			:Tuple	    =		_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)

