

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

SCREAMING_SNAKE_CASE_        =      TypeVar('KEY')
SCREAMING_SNAKE_CASE_        =      TypeVar('VAL')

@dataclass(frozen=UpperCAmelCase							, slots=UpperCAmelCase				)
class 				a  (	Generic[KEY, VAL]				):
						_lowercase    						=			42
						_lowercase    						=			42







class 				a  (	_Item				):


						def __init__(       self	):







										'''simple docstring'''


										super().__init__(A_						,					A_	)





						def __bool__(       self	):







										'''simple docstring'''


										return False







SCREAMING_SNAKE_CASE_        =      _DeletedItem()

class 				a  (	MutableMapping[KEY, VAL]				):


						def __init__(       self						,					A_ = 8						,					A_ = 0.75	):







										'''simple docstring'''


										_UpperCAmelCase       :		List[Any] 		=    initial_block_size
										_UpperCAmelCase       :		list[_Item | None] 		=    [None] * initial_block_size
										assert 0.0 < capacity_factor < 1.0
										_UpperCAmelCase       :		Union[str, Any] 		=    capacity_factor
										_UpperCAmelCase       :		str 		=    0


						def        _UpperCAmelCase				(       self						,					A_	):







										'''simple docstring'''


										return hash(A_	) % len(self._buckets	)


						def        _UpperCAmelCase				(       self						,					A_	):







										'''simple docstring'''


										return (ind + 1) % len(self._buckets	)


						def        _UpperCAmelCase				(       self						,					A_						,					A_						,					A_	):







										'''simple docstring'''


										_UpperCAmelCase       :		Optional[Any] 		=    self._buckets[ind]
										if not stored:
														_UpperCAmelCase       :		List[str] 		=    _Item(A_						,					A_	)
														self._len += 1
														return True
										elif stored.key == key:
														_UpperCAmelCase       :		List[str] 		=    _Item(A_						,					A_	)
														return True
										else:
														return False


						def        _UpperCAmelCase				(       self	):







										'''simple docstring'''


										_UpperCAmelCase       :		Tuple 		=    len(self._buckets	) * self._capacity_factor
										return len(self	) >= int(A_	)


						def        _UpperCAmelCase				(       self	):







										'''simple docstring'''


										if len(self._buckets	) <= self._initial_block_size:
														return False
										_UpperCAmelCase       :		Union[str, Any] 		=    len(self._buckets	) * self._capacity_factor / 2
										return len(self	) < limit


						def        _UpperCAmelCase				(       self						,					A_	):







										'''simple docstring'''


										_UpperCAmelCase       :		Tuple 		=    self._buckets
										_UpperCAmelCase       :		Union[str, Any] 		=    [None] * new_size
										_UpperCAmelCase       :		List[str] 		=    0
										for item in old_buckets:
														if item:
																		self._add_item(item.key						,					item.val	)


						def        _UpperCAmelCase				(       self	):







										'''simple docstring'''


										self._resize(len(self._buckets	) * 2	)


						def        _UpperCAmelCase				(       self	):







										'''simple docstring'''


										self._resize(len(self._buckets	) // 2	)


						def        _UpperCAmelCase				(       self						,					A_	):







										'''simple docstring'''


										_UpperCAmelCase       :		Optional[Any] 		=    self._get_bucket_index(A_	)
										for _ in range(len(self._buckets	)	):
														yield ind
														_UpperCAmelCase       :		int 		=    self._get_next_ind(A_	)


						def        _UpperCAmelCase				(       self						,					A_						,					A_	):







										'''simple docstring'''


										for ind in self._iterate_buckets(A_	):
														if self._try_set(A_						,					A_						,					A_	):
																		break


						def __setitem__(       self						,					A_						,					A_	):







										'''simple docstring'''


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

										self._add_item(A_						,					A_	)


						def __delitem__(       self						,					A_	):







										'''simple docstring'''


										for ind in self._iterate_buckets(A_	):
														_UpperCAmelCase       :		int 		=    self._buckets[ind]
														if item is None:
																		raise KeyError(A_	)
														if item is _deleted:
																		continue
														if item.key == key:
																		_UpperCAmelCase       :		Optional[Any] 		=    _deleted
																		self._len -= 1
																		break
										if self._is_sparse():
														self._size_down()


						def __getitem__(       self						,					A_	):







										'''simple docstring'''


										for ind in self._iterate_buckets(A_	):
														_UpperCAmelCase       :		Dict 		=    self._buckets[ind]
														if item is None:
																		break
														if item is _deleted:
																		continue
														if item.key == key:
																		return item.val
										raise KeyError(A_	)


						def __len__(       self	):







										'''simple docstring'''


										return self._len


						def __iter__(       self	):







										'''simple docstring'''


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





						def __repr__(       self	):







										'''simple docstring'''


										_UpperCAmelCase       :		Union[str, Any] 		=    " ,".join(
										    f'{item.key}: {item.val}' for item in self._buckets if item	)
										return f'HashMap({val_string})'





from ...configuration_utils import PretrainedConfig
from ...utils import logging


SCREAMING_SNAKE_CASE_        =      logging.get_logger(__name__)

SCREAMING_SNAKE_CASE_        =      {
    'facebook/timesformer': 'https://huggingface.co/facebook/timesformer/resolve/main/config.json',
}

class 				a  (	UpperCAmelCase				):
						_lowercase    						=			"timesformer"


						def __init__(       self						,					A_=224						,					A_=16						,					A_=3						,					A_=8						,					A_=768						,					A_=12						,					A_=12						,					A_=3072						,					A_="gelu"						,					A_=0.0						,					A_=0.0						,					A_=0.02						,					A_=1e-6						,					A_=True						,					A_="divided_space_time"						,					A_=0						,					**A_						,					):







										'''simple docstring'''


										super().__init__(**A_	)

										_UpperCAmelCase       :		Union[str, Any] 		=    image_size
										_UpperCAmelCase       :		Tuple 		=    patch_size
										_UpperCAmelCase       :		Any 		=    num_channels
										_UpperCAmelCase       :		List[Any] 		=    num_frames

										_UpperCAmelCase       :		str 		=    hidden_size
										_UpperCAmelCase       :		Any 		=    num_hidden_layers
										_UpperCAmelCase       :		Dict 		=    num_attention_heads
										_UpperCAmelCase       :		Optional[int] 		=    intermediate_size
										_UpperCAmelCase       :		Union[str, Any] 		=    hidden_act
										_UpperCAmelCase       :		Optional[Any] 		=    hidden_dropout_prob
										_UpperCAmelCase       :		Tuple 		=    attention_probs_dropout_prob
										_UpperCAmelCase       :		Union[str, Any] 		=    initializer_range
										_UpperCAmelCase       :		Optional[Any] 		=    layer_norm_eps
										_UpperCAmelCase       :		str 		=    qkv_bias

										_UpperCAmelCase       :		Tuple 		=    attention_type
										_UpperCAmelCase       :		List[Any] 		=    drop_path_rate


