'''simple docstring'''




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      lowerCamelCase_     (snake_case__   ):
      '''simple docstring'''

      __UpperCamelCase:  Union[List[PIL.Image.Image], np.ndarray]

class      lowerCamelCase_     (unittest.TestCase   ):
      '''simple docstring'''

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

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





      def 					_A     (	self						:    List[str]	):
             # test output reinitialization with a `dict` for compatibility with `accelerate`
             _UpperCAmelCase					:  str											=   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					:  str											=   CustomOutput({"images": [PIL.Image.new("RGB"						, (4, 4)	)]}	)

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


'''simple docstring'''




def      UpperCamelCase_							( _UpperCAmelCase  :				int   )   ->   bool:


       """simple docstring"""







       _UpperCAmelCase					:  Optional[int]											=   9

       while num > 0:
              if num % 10 != digit:
                     return False
              num //= 100
              digit -= 1

       return True

def      UpperCamelCase_							( )   ->   int:


       """simple docstring"""







       _UpperCAmelCase					:  Optional[Any]											=   138_902_663

       while not is_square_form(num * num   ):
              if num % 10 == 3:
                     num -= 6  # (3 - 6) % 10 = 7
              else:
                     num -= 4  # (7 - 4) % 10 = 3

       return num * 10


if __name__ == "__main__":
  print(F'{solution() = }')

