



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    _SCREAMING_SNAKE_CASE						(UpperCamelCase			):
     lowerCAmelCase       =      42






class    _SCREAMING_SNAKE_CASE						(unittest.TestCase			):





     def 						__snake_case     (							self			:				List[Any]					)->List[Any]:
      __SCREAMING_SNAKE_CASE							:     Any							=						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
      __SCREAMING_SNAKE_CASE							:     Optional[Any]							=						CustomOutput(images=[PIL.Image.new("RGB"  ,	(4, 4)					)]					)

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






     def 						__snake_case     (							self			:				Optional[int]					)->Tuple:
      # test output reinitialization with a `dict` for compatibility with `accelerate`
      __SCREAMING_SNAKE_CASE							:     Dict							=						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
      __SCREAMING_SNAKE_CASE							:     int							=						CustomOutput({"images": [PIL.Image.new("RGB"  ,	(4, 4)					)]}					)

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











from itertools import compress, repeat
from math import ceil, sqrt
def 						snake_case__							(       __lowercase							)		->		list[int]:







						"""simple docstring"""

						if num <= 2:
												return []
						if num == 3:
												return [2]

						# Odd sieve for numbers in range [3, num - 1]
						A__						:				Dict         =			bytearray(b"\x01"							) * ((num >> 1) - 1)

						for i in range(3				,  int(sqrt(__lowercase							)							) + 1				,  2							):
												if sieve[(i >> 1) - 1]:
																		A__						:				int         =			i**2
																		A__						:				List[str]         =			repeat(
																		    0				,  ceil((num - i_squared) / (i << 1)							)							)

						return [2] + list(compress(range(3				,  __lowercase				,  2							)				,  __lowercase							)							)


if __name__ == "__main__":
		import doctest

		doctest.testmod()