





'''simple docstring'''







import unittest
from dataclasses import dataclass
from typing import Optional

from transformers.utils import ModelOutput


@dataclass
class        __a   (lowerCamelCase  ):
							__a       : float
							__a       : Optional[float]          =							None
							__a       : Optional[float]          =							None





class        __a   (unittest.TestCase  ):

							def      UpperCAmelCase__						(				self				:  Tuple )       ->							Optional[int]:







													"""simple docstring"""
													UpperCAmelCase_      :   Tuple      =	ModelOutputTest(a=30 )
													self.assertEqual(x.a							,  30 )
													self.assertIsNone(x.b )
													self.assertIsNone(x.c )
													with self.assertRaises(__magic_name__ ):
																			UpperCAmelCase_      :   List[Any]      =	x.d

							def      UpperCAmelCase__						(				self				:  Dict )       ->							List[str]:







													"""simple docstring"""
													UpperCAmelCase_      :   Union[str, Any]      =	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_      :   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      UpperCAmelCase__						(				self				:  str )       ->							List[str]:







													"""simple docstring"""
													UpperCAmelCase_      :   str      =	ModelOutputTest(a=30							,  b=10 )
													self.assertEqual(x['''a''']							,  30 )
													self.assertEqual(x['''b''']							,  10 )
													with self.assertRaises(__magic_name__ ):
																			UpperCAmelCase_      :   Optional[Any]      =	x['''c''']

													UpperCAmelCase_      :   int      =	ModelOutputTest(a=30							,  c=10 )
													self.assertEqual(x['''a''']							,  30 )
													self.assertEqual(x['''c''']							,  10 )
													with self.assertRaises(__magic_name__ ):
																			UpperCAmelCase_      :   Union[str, Any]      =	x['''b''']

							def      UpperCAmelCase__						(				self				:  Optional[int] )       ->							Optional[Any]:







													"""simple docstring"""
													UpperCAmelCase_      :   Optional[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(__magic_name__ )							,  ['''a'''] )

													UpperCAmelCase_      :   str      =	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(__magic_name__ )							,  ['''a''', '''b'''] )

													UpperCAmelCase_      :   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(__magic_name__ )							,  ['''a''', '''c'''] )

													with self.assertRaises(__magic_name__ ):
																			UpperCAmelCase_      :   Any      =	x.update({'''d''': 20} )
													with self.assertRaises(__magic_name__ ):
																			del x["a"]
													with self.assertRaises(__magic_name__ ):
																			UpperCAmelCase_      :   Tuple      =	x.pop('''a''' )
													with self.assertRaises(__magic_name__ ):
																			UpperCAmelCase_      :   List[Any]      =	x.setdefault('''d'''							,  32 )

							def      UpperCAmelCase__						(				self				:  Tuple )       ->							List[str]:







													"""simple docstring"""
													UpperCAmelCase_      :   Optional[int]      =	ModelOutputTest(a=30 )
													UpperCAmelCase_      :   Union[str, Any]      =	10
													self.assertEqual(x.a							,  10 )
													self.assertEqual(x['''a''']							,  10 )

							def      UpperCAmelCase__						(				self				:  Tuple )       ->							str:







													"""simple docstring"""
													UpperCAmelCase_      :   int      =	ModelOutputTest(a=30 )
													UpperCAmelCase_      :   Dict      =	10
													self.assertEqual(x.a							,  10 )
													self.assertEqual(x['''a''']							,  10 )

							def      UpperCAmelCase__						(				self				:  Optional[int] )       ->							Optional[int]:







													"""simple docstring"""
													UpperCAmelCase_      :   Dict      =	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				:  Optional[int] )       ->							Tuple:







													"""simple docstring"""
													UpperCAmelCase_      :   Dict      =	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(__magic_name__ ):
																			UpperCAmelCase_      :   str      =	ModelOutputTest([('''a''', 30), (10, 10)] )

													UpperCAmelCase_      :   str      =	ModelOutputTest(a=(30, 30) )
													self.assertEqual(list(x.keys() )							,  ['''a'''] )
													self.assertEqual(x.a							,  (30, 30) )












'''simple docstring'''







from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


snake_case_  :							Any            =	{
    "configuration_flava": [
        "FLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP",
        "FlavaConfig",
        "FlavaImageCodebookConfig",
        "FlavaImageConfig",
        "FlavaMultimodalConfig",
        "FlavaTextConfig",
    ],
}

try:
					if not is_vision_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					snake_case_  :							List[str]            =	["FlavaFeatureExtractor"]
					snake_case_  :							int            =	["FlavaImageProcessor"]
					snake_case_  :							Tuple            =	["FlavaProcessor"]

try:
					if not is_torch_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					snake_case_  :							Optional[int]            =	[
					    "FLAVA_PRETRAINED_MODEL_ARCHIVE_LIST",
					    "FlavaForPreTraining",
					    "FlavaImageCodebook",
					    "FlavaImageModel",
					    "FlavaModel",
					    "FlavaMultimodalModel",
					    "FlavaPreTrainedModel",
					    "FlavaTextModel",
					]

if TYPE_CHECKING:
					from .configuration_flava import (
					    FLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP,
					    FlavaConfig,
					    FlavaImageCodebookConfig,
					    FlavaImageConfig,
					    FlavaMultimodalConfig,
					    FlavaTextConfig,
					)

					try:
										if not is_vision_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .feature_extraction_flava import FlavaFeatureExtractor
										from .image_processing_flava import FlavaImageProcessor
										from .processing_flava import FlavaProcessor

					try:
										if not is_torch_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_flava import (
										    FLAVA_PRETRAINED_MODEL_ARCHIVE_LIST,
										    FlavaForPreTraining,
										    FlavaImageCodebook,
										    FlavaImageModel,
										    FlavaModel,
										    FlavaMultimodalModel,
										    FlavaPreTrainedModel,
										    FlavaTextModel,
										)

else:
					import sys

					snake_case_  :							Any            =	_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)





