



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

_lowercase     							=						TypeVar('''KEY''')
_lowercase     							=						TypeVar('''VAL''')
@dataclass(frozen=A_					, slots=A_      )
class 				__A					( Generic[KEY, VAL]      ):
			UpperCamelCase					:KEY
			UpperCamelCase					:VAL







class 				__A					( _Item      ):





			def __init__(self				):
						super().__init__(__magic_name__							,    __magic_name__				)





			def __bool__(self				):
						return False







_lowercase     							=						_DeletedItem()
class 				__A					( MutableMapping[KEY, VAL]      ):





			def __init__(self							,    __magic_name__ = 8							,    __magic_name__ = 0.75				):
						lowerCamelCase__ :      Optional[int]								=		initial_block_size
						lowerCamelCase__ :      list[_Item | None]								=		[None] * initial_block_size
						assert 0.0 < capacity_factor < 1.0
						lowerCamelCase__ :      Optional[Any]								=		capacity_factor
						lowerCamelCase__ :      Tuple								=		0





			def        _snake_case    (self							,    __magic_name__				):
						return hash(__magic_name__				) % len(self._buckets				)





			def        _snake_case    (self							,    __magic_name__				):
						return (ind + 1) % len(self._buckets				)





			def        _snake_case    (self							,    __magic_name__							,    __magic_name__							,    __magic_name__				):
						lowerCamelCase__ :      str								=		self._buckets[ind]
						if not stored:
									lowerCamelCase__ :      Optional[Any]								=		_Item(__magic_name__							,    __magic_name__				)
									self._len += 1
									return True
						elif stored.key == key:
									lowerCamelCase__ :      Optional[int]								=		_Item(__magic_name__							,    __magic_name__				)
									return True
						else:
									return False





			def        _snake_case    (self				):
						lowerCamelCase__ :      Optional[Any]								=		len(self._buckets				) * self._capacity_factor
						return len(self				) >= int(__magic_name__				)





			def        _snake_case    (self				):
						if len(self._buckets				) <= self._initial_block_size:
									return False
						lowerCamelCase__ :      Dict								=		len(self._buckets				) * self._capacity_factor / 2
						return len(self				) < limit





			def        _snake_case    (self							,    __magic_name__				):
						lowerCamelCase__ :      List[str]								=		self._buckets
						lowerCamelCase__ :      Tuple								=		[None] * new_size
						lowerCamelCase__ :      Dict								=		0
						for item in old_buckets:
									if item:
												self._add_item(item.key							,    item.val				)





			def        _snake_case    (self				):
						self._resize(len(self._buckets				) * 2				)





			def        _snake_case    (self				):
						self._resize(len(self._buckets				) // 2				)





			def        _snake_case    (self							,    __magic_name__				):
						lowerCamelCase__ :      int								=		self._get_bucket_index(__magic_name__				)
						for _ in range(len(self._buckets				)				):
									yield ind
									lowerCamelCase__ :      int								=		self._get_next_ind(__magic_name__				)





			def        _snake_case    (self							,    __magic_name__							,    __magic_name__				):
						for ind in self._iterate_buckets(__magic_name__				):
									if self._try_set(__magic_name__							,    __magic_name__							,    __magic_name__				):
												break





			def __setitem__(self							,    __magic_name__							,    __magic_name__				):
						if self._is_full():
									self._size_up()

						self._add_item(__magic_name__							,    __magic_name__				)





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





			def __getitem__(self							,    __magic_name__				):
						for ind in self._iterate_buckets(__magic_name__				):
									lowerCamelCase__ :      List[str]								=		self._buckets[ind]
									if item is None:
												break
									if item is _deleted:
												continue
									if item.key == key:
												return item.val
						raise KeyError(__magic_name__				)





			def __len__(self				):
						return self._len





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





			def __repr__(self				):
						lowerCamelCase__ :      int								=		""" ,""".join(
						    f"{item.key}: {item.val}" for item in self._buckets if item				)
						return f"HashMap({val_string})"








import copy
from dataclasses import dataclass, field
from typing import ClassVar, Dict

from ..features import Audio, Features, Value
from .base import TaskTemplate
@dataclass(frozen=A_      )
class 				__A					( A_      ):
			UpperCamelCase					:str     =			field(default='''automatic-speech-recognition'''					, metadata={'''include_in_asdict_even_if_is_default''': True}      )
			UpperCamelCase					:ClassVar[Features]     =			Features({'''audio''': Audio()}      )
			UpperCamelCase					:ClassVar[Features]     =			Features({'''transcription''': Value('''string'''      )}      )
			UpperCamelCase					:str     =			"audio"
			UpperCamelCase					:str     =			"transcription"





			def        _snake_case    (self							,    __magic_name__				):
						if self.audio_column not in features:
									raise ValueError(f"Column {self.audio_column} is not present in features."				)
						if not isinstance(features[self.audio_column]							,    __magic_name__				):
									raise ValueError(f"Column {self.audio_column} is not an Audio type."				)
						lowerCamelCase__ :      int								=		copy.deepcopy(self				)
						lowerCamelCase__ :      Tuple								=		self.input_schema.copy()
						lowerCamelCase__ :      Tuple								=		features[self.audio_column]
						lowerCamelCase__ :      List[str]								=		input_schema
						return task_template





			@property
			def        _snake_case    (self				):
						return {self.audio_column: "audio", self.transcription_column: "transcription"}



