"""simple docstring"""






def  lowerCAmelCase_      (_SCREAMING_SNAKE_CASE	:list  )				-> bool:
						if not isinstance(_SCREAMING_SNAKE_CASE		,			_SCREAMING_SNAKE_CASE  ):
												raise ValueError("Input series is not valid, valid series - [1, 2/3, 2]"  )
						if len(_SCREAMING_SNAKE_CASE  ) == 0:
												raise ValueError("Input list must be a non empty list"  )
						if len(_SCREAMING_SNAKE_CASE  ) == 1 and series[0] != 0:
												return True
						a_							:			Union[str, Any]     		=					[]
						a_							:			Dict     		=					len(_SCREAMING_SNAKE_CASE  )
						for i in range(0		,			_SCREAMING_SNAKE_CASE  ):
												if series[i] == 0:
																		raise ValueError("Input series cannot have 0 as an element"  )
												rec_series.append(1 / series[i]  )
						a_							:			Tuple     		=					rec_series[1] - rec_series[0]
						for index in range(2		,			_SCREAMING_SNAKE_CASE  ):
												if rec_series[index] - rec_series[index - 1] != common_diff:
																		return False
						return True

def  lowerCAmelCase_      (_SCREAMING_SNAKE_CASE	:list  )				-> float:
						if not isinstance(_SCREAMING_SNAKE_CASE		,			_SCREAMING_SNAKE_CASE  ):
												raise ValueError("Input series is not valid, valid series - [2, 4, 6]"  )
						if len(_SCREAMING_SNAKE_CASE  ) == 0:
												raise ValueError("Input list must be a non empty list"  )
						a_							:			Optional[int]     		=					0
						for val in series:
												answer += 1 / val
						return len(_SCREAMING_SNAKE_CASE  ) / answer


if __name__ == "__main__":
				import doctest

				doctest.testmod()





"""simple docstring"""






import unittest

import torch

from diffusers import DDIMScheduler, TextToVideoZeroPipeline
from diffusers.utils import load_pt, require_torch_gpu, slow

from ..test_pipelines_common import assert_mean_pixel_difference
@slow
@require_torch_gpu
class   UpperCAmelCase__				(    unittest.TestCase			):


	"""simple docstring"""







	def       A    (			self )    ->	List[str]:
							a_							:			List[str]     		=					"runwayml/stable-diffusion-v1-5"
							a_							:			Optional[int]     		=					TextToVideoZeroPipeline.from_pretrained(_SCREAMING_SNAKE_CASE       ,     torch_dtype=torch.floataa ).to("cuda" )
							a_							:			Dict     		=					DDIMScheduler.from_config(pipe.scheduler.config )
							a_							:			Optional[Any]     		=					torch.Generator(device="cuda" ).manual_seed(0 )

							a_							:			List[Any]     		=					"A bear is playing a guitar on Times Square"
							a_							:			List[Any]     		=					pipe(prompt=_SCREAMING_SNAKE_CASE       ,     generator=_SCREAMING_SNAKE_CASE ).images

							a_							:			Optional[int]     		=					load_pt(
							    "https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/text-to-video/A bear is playing a guitar on Times Square.pt" )

							assert_mean_pixel_difference(_SCREAMING_SNAKE_CASE       ,     _SCREAMING_SNAKE_CASE )




