


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

lowerCamelCase_       :       Union[str, Any]      						=  TypeVar("""KEY""")
lowerCamelCase_       :       Optional[Any]      						=  TypeVar("""VAL""")






@dataclass(frozen=_SCREAMING_SNAKE_CASE,   slots=_SCREAMING_SNAKE_CASE      )
class 				__A    (	Generic[KEY, VAL]      ):






 """simple docstring"""




 __lowerCAmelCase			 =  42
 __lowerCAmelCase			 =  42






class 				__A    (	_Item      ):






 """simple docstring"""




 def __init__(		self						) ->					Optional[int]:
     super().__init__(_a			,   _a						)





 def __bool__(		self						) ->					Optional[int]:
     return False

lowerCamelCase_       :       int      						=  _DeletedItem()






class 				__A    (	MutableMapping[KEY, VAL]      ):






 """simple docstring"""




 def __init__(		self			,   __A = 8			,   __A = 0.75						) ->					List[str]:
     a					=initial_block_size
     a					=[None] * initial_block_size
     assert 0.0 < capacity_factor < 1.0
     a					=capacity_factor
     a					=0


 def 				SCREAMING_SNAKE_CASE							(		self			,   __A						) ->					List[Any]:
     return hash(_a						) % len(self._buckets						)


 def 				SCREAMING_SNAKE_CASE							(		self			,   __A						) ->					Optional[int]:
     return (ind + 1) % len(self._buckets						)


 def 				SCREAMING_SNAKE_CASE							(		self			,   __A			,   __A			,   __A						) ->					List[str]:
     a					=self._buckets[ind]
     if not stored:
         a					=_Item(_a			,   _a						)
         self._len += 1
         return True
     elif stored.key == key:
         a					=_Item(_a			,   _a						)
         return True
     else:
         return False


 def 				SCREAMING_SNAKE_CASE							(		self						) ->					str:
     a					=len(self._buckets						) * self._capacity_factor
     return len(self						) >= int(_a						)


 def 				SCREAMING_SNAKE_CASE							(		self						) ->					Optional[Any]:
     if len(self._buckets						) <= self._initial_block_size:
         return False
     a					=len(self._buckets						) * self._capacity_factor / 2
     return len(self						) < limit


 def 				SCREAMING_SNAKE_CASE							(		self			,   __A						) ->					List[str]:
     a					=self._buckets
     a					=[None] * new_size
     a					=0
     for item in old_buckets:
         if item:
             self._add_item(item.key			,   item.val						)


 def 				SCREAMING_SNAKE_CASE							(		self						) ->					Any:
     self._resize(len(self._buckets						) * 2						)


 def 				SCREAMING_SNAKE_CASE							(		self						) ->					int:
     self._resize(len(self._buckets						) // 2						)


 def 				SCREAMING_SNAKE_CASE							(		self			,   __A						) ->					List[Any]:
     a					=self._get_bucket_index(_a						)
     for _ in range(len(self._buckets						)						):
         yield ind
         a					=self._get_next_ind(_a						)


 def 				SCREAMING_SNAKE_CASE							(		self			,   __A			,   __A						) ->					Tuple:
     for ind in self._iterate_buckets(_a						):
         if self._try_set(_a			,   _a			,   _a						):
             break


 def __setitem__(		self			,   __A			,   __A						) ->					Optional[int]:
     if self._is_full():
         self._size_up()

     self._add_item(_a			,   _a						)


 def __delitem__(		self			,   __A						) ->					Optional[Any]:
     for ind in self._iterate_buckets(_a						):
         a					=self._buckets[ind]
         if item is None:
             raise KeyError(_a						)
         if item is _deleted:
             continue
         if item.key == key:
             a					=_deleted
             self._len -= 1
             break
     if self._is_sparse():
         self._size_down()


 def __getitem__(		self			,   __A						) ->					Optional[int]:
     for ind in self._iterate_buckets(_a						):
         a					=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						) ->					int:
     return self._len


 def __iter__(		self						) ->					Optional[Any]:
     yield from (item.key for item in self._buckets if item)





 def __repr__(		self						) ->					List[str]:
     a					=" ,".join(
         f'''{item.key}: {item.val}''' for item in self._buckets if item						)
     return f'''HashMap({val_string})'''



"""simple docstring"""







from ...processing_utils import ProcessorMixin






class 				__A    (	_SCREAMING_SNAKE_CASE      ):






 """simple docstring"""




 __lowerCAmelCase			 =  "WhisperFeatureExtractor"
 __lowerCAmelCase			 =  "WhisperTokenizer"


 def __init__(		self			,   __A			,   __A						) ->					Dict:
     super().__init__(__A			,   __A						)
     a					=self.feature_extractor
     a					=False


 def 				SCREAMING_SNAKE_CASE							(		self			,   __A=None			,   __A=None			,   __A=True						) ->					int:
     return self.tokenizer.get_decoder_prompt_ids(task=__A			,   language=__A			,   no_timestamps=__A						)


 def __call__(		self			,   *__A			,   **__A						) ->					Tuple:
     # For backward compatibility
     if self._in_target_context_manager:
         return self.current_processor(*__A			,   **__A						)

     a					=kwargs.pop('''audio'''			,   __A						)
     a					=kwargs.pop('''sampling_rate'''			,   __A						)
     a					=kwargs.pop('''text'''			,   __A						)
     if len(__A						) > 0:
         a					=args[0]
         a					=args[1:]

     if audio is None and text is None:
         raise ValueError('''You need to specify either an `audio` or `text` input to process.'''						)

     if audio is not None:
         a					=self.feature_extractor(__A			,   *__A			,   sampling_rate=__A			,   **__A						)
     if text is not None:
         a					=self.tokenizer(__A			,   **__A						)

     if text is None:
         return inputs

     elif audio is None:
         return encodings
     else:
         a					=encodings['''input_ids''']
         return inputs


 def 				SCREAMING_SNAKE_CASE							(		self			,   *__A			,   **__A						) ->					Optional[Any]:
     return self.tokenizer.batch_decode(*__A			,   **__A						)


 def 				SCREAMING_SNAKE_CASE							(		self			,   *__A			,   **__A						) ->					Union[str, Any]:
     return self.tokenizer.decode(*__A			,   **__A						)





 def 				SCREAMING_SNAKE_CASE							(		self			,   __A			,   __A="np"						) ->					Optional[Any]:
     return self.tokenizer.get_prompt_ids(__A			,   return_tensors=__A						)