



"""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_flax_available,
    is_sentencepiece_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


snake_case_      :					Dict				      =     {
    'configuration_big_bird': ['BIG_BIRD_PRETRAINED_CONFIG_ARCHIVE_MAP', 'BigBirdConfig', 'BigBirdOnnxConfig'],
}

try:
	if not is_sentencepiece_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	snake_case_      :					str				      =     ['BigBirdTokenizer']

try:
	if not is_tokenizers_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	snake_case_      :					Any				      =     ['BigBirdTokenizerFast']

try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	snake_case_      :					Optional[Any]				      =     [
	    'BIG_BIRD_PRETRAINED_MODEL_ARCHIVE_LIST',
	    'BigBirdForCausalLM',
	    'BigBirdForMaskedLM',
	    'BigBirdForMultipleChoice',
	    'BigBirdForPreTraining',
	    'BigBirdForQuestionAnswering',
	    'BigBirdForSequenceClassification',
	    'BigBirdForTokenClassification',
	    'BigBirdLayer',
	    'BigBirdModel',
	    'BigBirdPreTrainedModel',
	    'load_tf_weights_in_big_bird',
	]

try:
	if not is_flax_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	snake_case_      :					Any				      =     [
	    'FlaxBigBirdForCausalLM',
	    'FlaxBigBirdForMaskedLM',
	    'FlaxBigBirdForMultipleChoice',
	    'FlaxBigBirdForPreTraining',
	    'FlaxBigBirdForQuestionAnswering',
	    'FlaxBigBirdForSequenceClassification',
	    'FlaxBigBirdForTokenClassification',
	    'FlaxBigBirdModel',
	    'FlaxBigBirdPreTrainedModel',
	]

if TYPE_CHECKING:
	from .configuration_big_bird import BIG_BIRD_PRETRAINED_CONFIG_ARCHIVE_MAP, BigBirdConfig, BigBirdOnnxConfig

	try:
		if not is_sentencepiece_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .tokenization_big_bird import BigBirdTokenizer

	try:
		if not is_tokenizers_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .tokenization_big_bird_fast import BigBirdTokenizerFast

	try:
		if not is_torch_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_big_bird import (
		    BIG_BIRD_PRETRAINED_MODEL_ARCHIVE_LIST,
		    BigBirdForCausalLM,
		    BigBirdForMaskedLM,
		    BigBirdForMultipleChoice,
		    BigBirdForPreTraining,
		    BigBirdForQuestionAnswering,
		    BigBirdForSequenceClassification,
		    BigBirdForTokenClassification,
		    BigBirdLayer,
		    BigBirdModel,
		    BigBirdPreTrainedModel,
		    load_tf_weights_in_big_bird,
		)

	try:
		if not is_flax_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_flax_big_bird import (
		    FlaxBigBirdForCausalLM,
		    FlaxBigBirdForMaskedLM,
		    FlaxBigBirdForMultipleChoice,
		    FlaxBigBirdForPreTraining,
		    FlaxBigBirdForQuestionAnswering,
		    FlaxBigBirdForSequenceClassification,
		    FlaxBigBirdForTokenClassification,
		    FlaxBigBirdModel,
		    FlaxBigBirdPreTrainedModel,
		)

else:
	import sys

	snake_case_      :					int				      =     _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)
