


from collections.abc import Iterator, MutableMapping
from dataclasses import dataclass
from typing import Generic, TypeVar

lowerCAmelCase__  :int             =							TypeVar('''KEY''')
lowerCAmelCase__  :List[str]             =							TypeVar('''VAL''')

@dataclass(frozen=UpperCAmelCase   ,				slots=UpperCAmelCase      )
class 		__a				(    Generic[KEY, VAL]      ):
		_a     :  KEY
		_a     :  VAL



class 		__a				(    _Item      ):
		def __init__(      self						)			->	None:




									"""simple docstring"""





									super().__init__(_SCREAMING_SNAKE_CASE      ,   _SCREAMING_SNAKE_CASE						)






		def __bool__(      self						)			->	bool:




									"""simple docstring"""





									return False



lowerCAmelCase__  :Optional[Any]             =							_DeletedItem()

class 		__a				(    MutableMapping[KEY, VAL]      ):
		def __init__(      self      ,   _SCREAMING_SNAKE_CASE = 8      ,   _SCREAMING_SNAKE_CASE = 0.75						)			->	None:




									"""simple docstring"""





									_UpperCAmelCase					=      initial_block_size
									_UpperCAmelCase					=      [None] * initial_block_size
									assert 0.0 < capacity_factor < 1.0
									_UpperCAmelCase					=      capacity_factor
									_UpperCAmelCase					=      0
		def      UpperCAmelCase__    (      self      ,   _SCREAMING_SNAKE_CASE						)			->	int:




									"""simple docstring"""





									return hash(_SCREAMING_SNAKE_CASE						) % len(self._buckets						)
		def      UpperCAmelCase__    (      self      ,   _SCREAMING_SNAKE_CASE						)			->	int:




									"""simple docstring"""





									return (ind + 1) % len(self._buckets						)
		def      UpperCAmelCase__    (      self      ,   _SCREAMING_SNAKE_CASE      ,   _SCREAMING_SNAKE_CASE      ,   _SCREAMING_SNAKE_CASE						)			->	bool:




									"""simple docstring"""





									_UpperCAmelCase					=      self._buckets[ind]
									if not stored:
																_UpperCAmelCase					=      _Item(_SCREAMING_SNAKE_CASE      ,   _SCREAMING_SNAKE_CASE						)
																self._len += 1
																return True
									elif stored.key == key:
																_UpperCAmelCase					=      _Item(_SCREAMING_SNAKE_CASE      ,   _SCREAMING_SNAKE_CASE						)
																return True
									else:
																return False
		def      UpperCAmelCase__    (      self						)			->	bool:




									"""simple docstring"""





									_UpperCAmelCase					=      len(self._buckets						) * self._capacity_factor
									return len(self						) >= int(_SCREAMING_SNAKE_CASE						)
		def      UpperCAmelCase__    (      self						)			->	bool:




									"""simple docstring"""





									if len(self._buckets						) <= self._initial_block_size:
																return False
									_UpperCAmelCase					=      len(self._buckets						) * self._capacity_factor / 2
									return len(self						) < limit
		def      UpperCAmelCase__    (      self      ,   _SCREAMING_SNAKE_CASE						)			->	None:




									"""simple docstring"""





									_UpperCAmelCase					=      self._buckets
									_UpperCAmelCase					=      [None] * new_size
									_UpperCAmelCase					=      0
									for item in old_buckets:
																if item:
																							self._add_item(item.key      ,   item.val						)
		def      UpperCAmelCase__    (      self						)			->	None:




									"""simple docstring"""





									self._resize(len(self._buckets						) * 2						)
		def      UpperCAmelCase__    (      self						)			->	None:




									"""simple docstring"""





									self._resize(len(self._buckets						) // 2						)
		def      UpperCAmelCase__    (      self      ,   _SCREAMING_SNAKE_CASE						)			->	Iterator[int]:




									"""simple docstring"""





									_UpperCAmelCase					=      self._get_bucket_index(_SCREAMING_SNAKE_CASE						)
									for _ in range(len(self._buckets						)						):
																yield ind
																_UpperCAmelCase					=      self._get_next_ind(_SCREAMING_SNAKE_CASE						)
		def      UpperCAmelCase__    (      self      ,   _SCREAMING_SNAKE_CASE      ,   _SCREAMING_SNAKE_CASE						)			->	None:




									"""simple docstring"""





									for ind in self._iterate_buckets(_SCREAMING_SNAKE_CASE						):
																if self._try_set(_SCREAMING_SNAKE_CASE      ,   _SCREAMING_SNAKE_CASE      ,   _SCREAMING_SNAKE_CASE						):
																							break
		def __setitem__(      self      ,   _SCREAMING_SNAKE_CASE      ,   _SCREAMING_SNAKE_CASE						)			->	None:




									"""simple docstring"""





									if self._is_full():
																self._size_up()

									self._add_item(_SCREAMING_SNAKE_CASE      ,   _SCREAMING_SNAKE_CASE						)
		def __delitem__(      self      ,   _SCREAMING_SNAKE_CASE						)			->	None:




									"""simple docstring"""





									for ind in self._iterate_buckets(_SCREAMING_SNAKE_CASE						):
																_UpperCAmelCase					=      self._buckets[ind]
																if item is None:
																							raise KeyError(_SCREAMING_SNAKE_CASE						)
																if item is _deleted:
																							continue
																if item.key == key:
																							_UpperCAmelCase					=      _deleted
																							self._len -= 1
																							break
									if self._is_sparse():
																self._size_down()
		def __getitem__(      self      ,   _SCREAMING_SNAKE_CASE						)			->	VAL:




									"""simple docstring"""





									for ind in self._iterate_buckets(_SCREAMING_SNAKE_CASE						):
																_UpperCAmelCase					=      self._buckets[ind]
																if item is None:
																							break
																if item is _deleted:
																							continue
																if item.key == key:
																							return item.val
									raise KeyError(_SCREAMING_SNAKE_CASE						)
		def __len__(      self						)			->	int:




									"""simple docstring"""





									return self._len
		def __iter__(      self						)			->	Iterator[KEY]:




									"""simple docstring"""





									yield from (item.key for item in self._buckets if item)






		def __repr__(      self						)			->	str:




									"""simple docstring"""





									_UpperCAmelCase					=      ' ,'.join(
									    f'''{item.key}: {item.val}''' for item in self._buckets if item						)
									return f'''HashMap({val_string})'''




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

import numpy as np
import torch

from ...utils import BaseOutput, OptionalDependencyNotAvailable, is_torch_available, is_transformers_available

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


try:
		if not (is_transformers_available() and is_torch_available()):
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		from ...utils.dummy_torch_and_transformers_objects import *  # noqa F403
else:
		from .pipeline_text_to_video_synth import TextToVideoSDPipeline
		from .pipeline_text_to_video_synth_imgaimg import VideoToVideoSDPipeline  # noqa: F401
		from .pipeline_text_to_video_zero import TextToVideoZeroPipeline
