


"""simple docstring"""






import unittest
from dataclasses import dataclass
from typing import Optional

from transformers.utils import ModelOutput




@dataclass
class 				A_	(    a_      ):
  lowerCAmelCase__	       =     42
  lowerCAmelCase__	       =     None
  lowerCAmelCase__	       =     None




class 				A_	(    unittest.TestCase      ):


  def 				_lowercase (       self:		List[str]  ):







     '''simple docstring'''







     _lowerCamelCase					:							List[str]				=			ModelOutputTest(a=30  )
     self.assertEqual(x.a				,30  )
     self.assertIsNone(x.b  )
     self.assertIsNone(x.c  )
     with self.assertRaises(__lowerCAmelCase  ):
        _lowerCamelCase					:							Optional[Any]				=			x.d


  def 				_lowercase (       self:		Dict  ):







     '''simple docstring'''







     _lowerCamelCase					:							str				=			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)  )

     _lowerCamelCase					:							Dict				=			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 				_lowercase (       self:		Optional[int]  ):







     '''simple docstring'''







     _lowerCamelCase					:							Any				=			ModelOutputTest(a=30				,b=10  )
     self.assertEqual(x["a"]				,30  )
     self.assertEqual(x["b"]				,10  )
     with self.assertRaises(__lowerCAmelCase  ):
        _lowerCamelCase					:							Any				=			x['c']

     _lowerCamelCase					:							int				=			ModelOutputTest(a=30				,c=10  )
     self.assertEqual(x["a"]				,30  )
     self.assertEqual(x["c"]				,10  )
     with self.assertRaises(__lowerCAmelCase  ):
        _lowerCamelCase					:							List[str]				=			x['b']


  def 				_lowercase (       self:		str  ):







     '''simple docstring'''







     _lowerCamelCase					:							int				=			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(__lowerCAmelCase  )				,["a"]  )

     _lowerCamelCase					:							Dict				=			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(__lowerCAmelCase  )				,["a", "b"]  )

     _lowerCamelCase					:							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(__lowerCAmelCase  )				,["a", "c"]  )

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


  def 				_lowercase (       self:		str  ):







     '''simple docstring'''







     _lowerCamelCase					:							str				=			ModelOutputTest(a=30  )
     _lowerCamelCase					:							List[Any]				=			10
     self.assertEqual(x.a				,10  )
     self.assertEqual(x["a"]				,10  )


  def 				_lowercase (       self:		Optional[int]  ):







     '''simple docstring'''







     _lowerCamelCase					:							Optional[Any]				=			ModelOutputTest(a=30  )
     _lowerCamelCase					:							List[str]				=			10
     self.assertEqual(x.a				,10  )
     self.assertEqual(x["a"]				,10  )


  def 				_lowercase (       self:		Any  ):







     '''simple docstring'''







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






  def 				_lowercase (       self:		Optional[int]  ):







     '''simple docstring'''







     _lowerCamelCase					:							Optional[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(__lowerCAmelCase  ):
        _lowerCamelCase					:							Any				=			ModelOutputTest([("a", 30), (10, 10)]  )

     _lowerCamelCase					:							str				=			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


UpperCAmelCase							= {'''configuration_nat''': ['''NAT_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''NatConfig''']}


try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 UpperCAmelCase							= [
     '''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

 UpperCAmelCase							= _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)



