


import unittest
from dataclasses import dataclass
from typing import List, Union

import numpy as np
import PIL.Image

from diffusers.utils.outputs import BaseOutput

@dataclass
class 	__a   (       UpperCAmelCase    ):
		_a			:						Union[List[PIL.Image.Image], np.ndarray]



class 	__a   (       unittest.TestCase    ):
		def 			UpperCAmelCase__       (    self		)				-> List[Any]:




									"""simple docstring"""





									_UpperCAmelCase					=    CustomOutput(images=np.random.rand(1    ,					3    ,					4    ,					4		)		)

									# check every way of getting the attribute
									assert isinstance(outputs.images    ,					np.ndarray		)
									assert outputs.images.shape == (1, 3, 4, 4)
									assert isinstance(outputs['images']    ,					np.ndarray		)
									assert outputs["images"].shape == (1, 3, 4, 4)
									assert isinstance(outputs[0]    ,					np.ndarray		)
									assert outputs[0].shape == (1, 3, 4, 4)

									# test with a non-tensor attribute
									_UpperCAmelCase					=    CustomOutput(images=[PIL.Image.new('RGB'    ,					(4, 4)		)]		)

									# check every way of getting the attribute
									assert isinstance(outputs.images    ,					_SCREAMING_SNAKE_CASE		)
									assert isinstance(outputs.images[0]    ,					PIL.Image.Image		)
									assert isinstance(outputs['images']    ,					_SCREAMING_SNAKE_CASE		)
									assert isinstance(outputs['images'][0]    ,					PIL.Image.Image		)
									assert isinstance(outputs[0]    ,					_SCREAMING_SNAKE_CASE		)
									assert isinstance(outputs[0][0]    ,					PIL.Image.Image		)

		def 			UpperCAmelCase__       (    self		)				-> List[Any]:




									"""simple docstring"""





									_UpperCAmelCase					=    CustomOutput({'images': np.random.rand(1    ,					3    ,					4    ,					4		)}		)

									# check every way of getting the attribute
									assert isinstance(outputs.images    ,					np.ndarray		)
									assert outputs.images.shape == (1, 3, 4, 4)
									assert isinstance(outputs['images']    ,					np.ndarray		)
									assert outputs["images"].shape == (1, 3, 4, 4)
									assert isinstance(outputs[0]    ,					np.ndarray		)
									assert outputs[0].shape == (1, 3, 4, 4)

									# test with a non-tensor attribute
									_UpperCAmelCase					=    CustomOutput({'images': [PIL.Image.new('RGB'    ,					(4, 4)		)]}		)

									# check every way of getting the attribute
									assert isinstance(outputs.images    ,					_SCREAMING_SNAKE_CASE		)
									assert isinstance(outputs.images[0]    ,					PIL.Image.Image		)
									assert isinstance(outputs['images']    ,					_SCREAMING_SNAKE_CASE		)
									assert isinstance(outputs['images'][0]    ,					PIL.Image.Image		)
									assert isinstance(outputs[0]    ,					_SCREAMING_SNAKE_CASE		)
									assert isinstance(outputs[0][0]    ,					PIL.Image.Image		)




from __future__ import annotations

def  lowerCAmelCase__				(    a__:	list[int]    ,						a__:	int )						->	list[int]:


							'''simple docstring'''





							_UpperCAmelCase					=    {}
							for index, val in enumerate(a__ ):
														_UpperCAmelCase					=    target - val
														if compl in chk_map:
																					return [chk_map[compl], index]
														_UpperCAmelCase					=    index
							return []


if __name__ == "__main__":
		import doctest

		doctest.testmod()
		print(f'''{two_sum([2, 7, 1_1, 1_5], 9) = }''')
