



UpperCAmelCase							       =    """\n# Diffusers installation\n! pip install diffusers transformers datasets accelerate\n# To install from source instead of the last release, comment the command above and uncomment the following one.\n# ! pip install git+https://github.com/huggingface/diffusers.git\n"""

UpperCAmelCase							       =    [{"""type""": """code""", """content""": INSTALL_CONTENT}]







import unittest
from dataclasses import dataclass
from typing import Optional

from transformers.utils import ModelOutput
@dataclass
class       __a					( __lowerCamelCase     ):


     """simple docstring"""


     _A				:    float
     _A				:    Optional[float]									=  None
     _A				:    Optional[float]									=  None






class       __a					( unittest.TestCase     ):


     """simple docstring"""


     def   __A				(	self			: Dict						)		->   Optional[int]:


         '''simple docstring'''





         SCREAMING_SNAKE_CASE__								=ModelOutputTest(a=3_0						)
         self.assertEqual(x.a				,3_0						)
         self.assertIsNone(x.b						)
         self.assertIsNone(x.c						)
         with self.assertRaises(_UpperCamelCase						):
             SCREAMING_SNAKE_CASE__								=x.d




     def   __A				(	self			: Tuple						)		->   Dict:


         '''simple docstring'''





         SCREAMING_SNAKE_CASE__								=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)						)

         SCREAMING_SNAKE_CASE__								=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   __A				(	self			: List[str]						)		->   Dict:


         '''simple docstring'''





         SCREAMING_SNAKE_CASE__								=ModelOutputTest(a=3_0				,b=1_0						)
         self.assertEqual(x["""a"""]				,3_0						)
         self.assertEqual(x["""b"""]				,1_0						)
         with self.assertRaises(_UpperCamelCase						):
             SCREAMING_SNAKE_CASE__								=x["""c"""]

         SCREAMING_SNAKE_CASE__								=ModelOutputTest(a=3_0				,c=1_0						)
         self.assertEqual(x["""a"""]				,3_0						)
         self.assertEqual(x["""c"""]				,1_0						)
         with self.assertRaises(_UpperCamelCase						):
             SCREAMING_SNAKE_CASE__								=x["""b"""]




     def   __A				(	self			: Optional[int]						)		->   List[str]:


         '''simple docstring'''





         SCREAMING_SNAKE_CASE__								=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(_UpperCamelCase						)				,["""a"""]						)

         SCREAMING_SNAKE_CASE__								=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(_UpperCamelCase						)				,["""a""", """b"""]						)

         SCREAMING_SNAKE_CASE__								=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(_UpperCamelCase						)				,["""a""", """c"""]						)

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




     def   __A				(	self			: int						)		->   List[Any]:


         '''simple docstring'''





         SCREAMING_SNAKE_CASE__								=ModelOutputTest(a=3_0						)
         SCREAMING_SNAKE_CASE__								=1_0
         self.assertEqual(x.a				,1_0						)
         self.assertEqual(x["""a"""]				,1_0						)




     def   __A				(	self			: Union[str, Any]						)		->   Optional[Any]:


         '''simple docstring'''





         SCREAMING_SNAKE_CASE__								=ModelOutputTest(a=3_0						)
         SCREAMING_SNAKE_CASE__								=1_0
         self.assertEqual(x.a				,1_0						)
         self.assertEqual(x["""a"""]				,1_0						)




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


         '''simple docstring'''





         SCREAMING_SNAKE_CASE__								=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   __A				(	self			: Optional[int]						)		->   int:


         '''simple docstring'''





         SCREAMING_SNAKE_CASE__								=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(_UpperCamelCase						):
             SCREAMING_SNAKE_CASE__								=ModelOutputTest([("""a""", 3_0), (1_0, 1_0)]						)

         SCREAMING_SNAKE_CASE__								=ModelOutputTest(a=(3_0, 3_0)						)
         self.assertEqual(list(x.keys()						)				,["""a"""]						)
         self.assertEqual(x.a				,(3_0, 3_0)						)






