



"""simple docstring"""
def   A_    (     _lowercase,   _lowercase,   _lowercase,   _lowercase,   _lowercase      ):







						'''simple docstring'''


						if target == 0:
												answer.append(path.copy()      )
						else:
												for index in range(_lowercase,   len(_lowercase      )      ):
																		if target >= candidates[index]:
																								path.append(candidates[index]      )
																								backtrack(_lowercase,   _lowercase,   _lowercase,   target - candidates[index],   _lowercase      )
																								path.pop(len(_lowercase      ) - 1      )
def   A_    (     _lowercase,   _lowercase      ):







						'''simple docstring'''


						snake_case_					:Optional[Any]		=     []  # type: list[int]
						snake_case_					:str		=     []  # type: list[int]
						backtrack(_lowercase,   _lowercase,   _lowercase,   _lowercase,   0      )
						return answer
def   A_    (     ):







						'''simple docstring'''


						print(combination_sum([-8, 2.3, 0],   1      )      )


if __name__ == "__main__":
						import doctest

						doctest.testmod()
						main()





'''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 						UpperCAmelCase						(		__a):


 '''simple docstring'''




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







class 						UpperCAmelCase						(		unittest.TestCase):


 '''simple docstring'''




 def    lowercase_	( self)			->   List[str]:



      """simple docstring"""







      a_									=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
      a_									=CustomOutput(images=[PIL.Image.new("RGB"				,	(4, 4))])

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




 def    lowercase_	( self)			->   Optional[int]:



      """simple docstring"""







      a_									=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
      a_									=CustomOutput({"images": [PIL.Image.new("RGB"				,	(4, 4))]})

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


