




import unittest
from dataclasses import dataclass
from typing import Optional

from transformers.utils import ModelOutput

@dataclass
class 			_lowerCamelCase    (      _SCREAMING_SNAKE_CASE ):

      """simple docstring"""

      lowerCAmelCase__      :			float
      lowerCAmelCase__      :			Optional[float]     =       None
      lowerCAmelCase__      :			Optional[float]     =       None







class 			_lowerCamelCase    (      unittest.TestCase ):

      """simple docstring"""

      def    snake_case						(  self       :			str					):
          __UpperCamelCase			=    ModelOutputTest(a=30					)
          self.assertEqual(x.a			,							30					)
          self.assertIsNone(x.b					)
          self.assertIsNone(x.c					)
          with self.assertRaises(snake_case					):
              __UpperCamelCase			=    x.d







      def    snake_case						(  self       :			Tuple					):
          __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    snake_case						(  self       :			List[str]					):
          __UpperCamelCase			=    ModelOutputTest(a=30			,							b=10					)
          self.assertEqual(x['''a''']			,							30					)
          self.assertEqual(x['''b''']			,							10					)
          with self.assertRaises(snake_case					):
              __UpperCamelCase			=    x['''c''']

          __UpperCamelCase			=    ModelOutputTest(a=30			,							c=10					)
          self.assertEqual(x['''a''']			,							30					)
          self.assertEqual(x['''c''']			,							10					)
          with self.assertRaises(snake_case					):
              __UpperCamelCase			=    x['''b''']







      def    snake_case						(  self       :			Tuple					):
          __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(snake_case					)			,							['''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(snake_case					)			,							['''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(snake_case					)			,							['''a''', '''c''']					)

          with self.assertRaises(snake_case					):
              __UpperCamelCase			=    x.update({'''d''': 20}					)
          with self.assertRaises(snake_case					):
              del x["a"]
          with self.assertRaises(snake_case					):
              __UpperCamelCase			=    x.pop('''a'''					)
          with self.assertRaises(snake_case					):
              __UpperCamelCase			=    x.setdefault('''d'''			,							32					)







      def    snake_case						(  self       :			Optional[Any]					):
          __UpperCamelCase			=    ModelOutputTest(a=30					)
          __UpperCamelCase			=    10
          self.assertEqual(x.a			,							10					)
          self.assertEqual(x['''a''']			,							10					)







      def    snake_case						(  self       :			Optional[int]					):
          __UpperCamelCase			=    ModelOutputTest(a=30					)
          __UpperCamelCase			=    10
          self.assertEqual(x.a			,							10					)
          self.assertEqual(x['''a''']			,							10					)







      def    snake_case						(  self       :			Optional[Any]					):
          __UpperCamelCase			=    ModelOutputTest({'''a''': 30, '''b''': 10}					)
          self.assertEqual(list(x.keys()					)			,							['''a''', '''b''']					)
          self.assertEqual(x.a			,							30					)
          self.assertEqual(x.b			,							10					)







      def    snake_case						(  self       :			Any					):
          __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(snake_case					):
              __UpperCamelCase			=    ModelOutputTest([('''a''', 30), (10, 10)]					)

          __UpperCamelCase			=    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_sentencepiece_available,
    is_tokenizers_available,
    is_torch_available,
)


SCREAMING_SNAKE_CASE__       =	{
    "configuration_open_llama": ["OPEN_LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP", "OpenLlamaConfig"],
}

try:
					if not is_sentencepiece_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					SCREAMING_SNAKE_CASE__       =	["LlamaTokenizer"]

try:
					if not is_tokenizers_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					SCREAMING_SNAKE_CASE__       =	["LlamaTokenizerFast"]

try:
					if not is_torch_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					SCREAMING_SNAKE_CASE__       =	[
					    "OpenLlamaForCausalLM",
					    "OpenLlamaModel",
					    "OpenLlamaPreTrainedModel",
					    "OpenLlamaForSequenceClassification",
					]


if TYPE_CHECKING:
					from .configuration_open_llama import OPEN_LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP, OpenLlamaConfig

					try:
										if not is_sentencepiece_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from transformers import LlamaTokenizer

					try:
										if not is_tokenizers_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from transformers import LlamaTokenizerFast

					try:
										if not is_torch_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_open_llama import (
										    OpenLlamaForCausalLM,
										    OpenLlamaForSequenceClassification,
										    OpenLlamaModel,
										    OpenLlamaPreTrainedModel,
										)


else:
					import sys

					SCREAMING_SNAKE_CASE__       =	_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)


