import unittest
from dataclasses import dataclass
from typing import Optional

from transformers.utils import ModelOutput




@dataclass
class       __lowerCAmelCase     (				a_  ):



 '''simple docstring'''
 _lowerCamelCase  :		float
 _lowerCamelCase  :		Optional[float] 			=       None
 _lowerCamelCase  :		Optional[float] 			=       None







class       __lowerCAmelCase     (				unittest.TestCase  ):



 '''simple docstring'''

 def     __snake_case    (	self				:						List[str]     )       ->							Optional[int]:
        _UpperCamelCase   :				List[str]       =     ModelOutputTest(a=3_0     )
        self.assertEqual(x.a				,	3_0     )
        self.assertIsNone(x.b     )
        self.assertIsNone(x.c     )
        with self.assertRaises(lowerCamelCase     ):
               _UpperCamelCase   :				Optional[Any]       =     x.d

 def     __snake_case    (	self				:						Dict     )       ->							Tuple:
        _UpperCamelCase   :				str       =     ModelOutputTest(a=3_0				,	b=1_0     )
        self.assertEqual(x[0]				,	3_0     )
        self.assertEqual(x[1]				,	1_0     )
        self.assertEqual(x[:2]				,	(3_0, 1_0)     )
        self.assertEqual(x[:]				,	(3_0, 1_0)     )

        _UpperCamelCase   :				Dict       =     ModelOutputTest(a=3_0				,	c=1_0     )
        self.assertEqual(x[0]				,	3_0     )
        self.assertEqual(x[1]				,	1_0     )
        self.assertEqual(x[:2]				,	(3_0, 1_0)     )
        self.assertEqual(x[:]				,	(3_0, 1_0)     )

 def     __snake_case    (	self				:						Optional[int]     )       ->							Union[str, Any]:
        _UpperCamelCase   :				Any       =     ModelOutputTest(a=3_0				,	b=1_0     )
        self.assertEqual(x['a']				,	3_0     )
        self.assertEqual(x['b']				,	1_0     )
        with self.assertRaises(lowerCamelCase     ):
               _UpperCamelCase   :				Any       =     x['c']

        _UpperCamelCase   :				int       =     ModelOutputTest(a=3_0				,	c=1_0     )
        self.assertEqual(x['a']				,	3_0     )
        self.assertEqual(x['c']				,	1_0     )
        with self.assertRaises(lowerCamelCase     ):
               _UpperCamelCase   :				List[str]       =     x['b']

 def     __snake_case    (	self				:						str     )       ->							List[str]:
        _UpperCamelCase   :				int       =     ModelOutputTest(a=3_0     )
        self.assertEqual(list(x.keys()     )				,	['a']     )
        self.assertEqual(list(x.values()     )				,	[3_0]     )
        self.assertEqual(list(x.items()     )				,	[('a', 3_0)]     )
        self.assertEqual(list(lowerCamelCase     )				,	['a']     )

        _UpperCamelCase   :				Dict       =     ModelOutputTest(a=3_0				,	b=1_0     )
        self.assertEqual(list(x.keys()     )				,	['a', 'b']     )
        self.assertEqual(list(x.values()     )				,	[3_0, 1_0]     )
        self.assertEqual(list(x.items()     )				,	[('a', 3_0), ('b', 1_0)]     )
        self.assertEqual(list(lowerCamelCase     )				,	['a', 'b']     )

        _UpperCamelCase   :				int       =     ModelOutputTest(a=3_0				,	c=1_0     )
        self.assertEqual(list(x.keys()     )				,	['a', 'c']     )
        self.assertEqual(list(x.values()     )				,	[3_0, 1_0]     )
        self.assertEqual(list(x.items()     )				,	[('a', 3_0), ('c', 1_0)]     )
        self.assertEqual(list(lowerCamelCase     )				,	['a', 'c']     )

        with self.assertRaises(lowerCamelCase     ):
               _UpperCamelCase   :				List[Any]       =     x.update({'d': 2_0}     )
        with self.assertRaises(lowerCamelCase     ):
               del x["a"]
        with self.assertRaises(lowerCamelCase     ):
               _UpperCamelCase   :				List[str]       =     x.pop('a'     )
        with self.assertRaises(lowerCamelCase     ):
               _UpperCamelCase   :				Any       =     x.setdefault('d'				,	3_2     )

 def     __snake_case    (	self				:						str     )       ->							Optional[Any]:
        _UpperCamelCase   :				str       =     ModelOutputTest(a=3_0     )
        _UpperCamelCase   :				List[Any]       =     1_0
        self.assertEqual(x.a				,	1_0     )
        self.assertEqual(x['a']				,	1_0     )

 def     __snake_case    (	self				:						Optional[int]     )       ->							List[Any]:
        _UpperCamelCase   :				Optional[Any]       =     ModelOutputTest(a=3_0     )
        _UpperCamelCase   :				List[str]       =     1_0
        self.assertEqual(x.a				,	1_0     )
        self.assertEqual(x['a']				,	1_0     )

 def     __snake_case    (	self				:						Any     )       ->							str:
        _UpperCamelCase   :				Optional[int]       =     ModelOutputTest({'a': 3_0, 'b': 1_0}     )
        self.assertEqual(list(x.keys()     )				,	['a', 'b']     )
        self.assertEqual(x.a				,	3_0     )
        self.assertEqual(x.b				,	1_0     )

 def     __snake_case    (	self				:						Optional[int]     )       ->							List[str]:
        _UpperCamelCase   :				Optional[Any]       =     ModelOutputTest([('a', 3_0), ('b', 1_0)]     )
        self.assertEqual(list(x.keys()     )				,	['a', 'b']     )
        self.assertEqual(x.a				,	3_0     )
        self.assertEqual(x.b				,	1_0     )

        with self.assertRaises(lowerCamelCase     ):
               _UpperCamelCase   :				Any       =     ModelOutputTest([('a', 3_0), (1_0, 1_0)]     )

        _UpperCamelCase   :				str       =     ModelOutputTest(a=(3_0, 3_0)     )
        self.assertEqual(list(x.keys()     )				,	['a']     )
        self.assertEqual(x.a				,	(3_0, 3_0)     )




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



