



class 				_UpperCAmelCase :

				"""simple docstring"""




				class 				_UpperCAmelCase :

								"""simple docstring"""




								lowercase__    							=	"""_prev""", """_data""", """_next"""




								def __init__(					self						:   Any,  lowerCamelCase						:   Dict,  lowerCamelCase						:   List[str],  lowerCamelCase						:   List[str]  ):

												'''simple docstring'''
												lowercase__       			=      link_p
												lowercase__       			=      element
												lowercase__       			=      link_n




								def     lowercase__       (					self						:   List[Any]  ):

												'''simple docstring'''
												return (
												    F""" Prev -> {self._prev is not None}, Next -> {self._next is not None}"""
												)




				def __init__(					self						:   int  ):

								'''simple docstring'''
								lowercase__       			=      self._Node(snake_case_,  snake_case_,  snake_case_  )
								lowercase__       			=      self._Node(snake_case_,  snake_case_,  snake_case_  )
								lowercase__       			=      self._trailer
								lowercase__       			=      self._header
								lowercase__       			=      0




				def __len__(					self						:   Optional[int]  ):

								'''simple docstring'''
								return self._size




				def     lowercase__       (					self						:   str  ):

								'''simple docstring'''
								return self.__len__() == 0




				def     lowercase__       (					self						:   Optional[Any],  lowerCamelCase						:   Optional[Any],  lowerCamelCase						:   Optional[int],  lowerCamelCase						:   str  ):

								'''simple docstring'''
								# Create new_node by setting it's prev.link -> header
								# setting it's next.link -> trailer
								lowercase__       			=      self._Node(snake_case_,  snake_case_,  snake_case_  )
								lowercase__       			=      new_node
								lowercase__       			=      new_node
								self._size += 1
								return self




				def     lowercase__       (					self						:   List[Any],  lowerCamelCase						:   Union[str, Any]  ):

								'''simple docstring'''
								lowercase__       			=      node._prev
								lowercase__       			=      node._next

								lowercase__       			=      successor
								lowercase__       			=      predecessor
								self._size -= 1
								lowercase__       			=      node._data
								lowercase__       			=      None
								del node
								return temp



class 				_UpperCAmelCase (	_DoublyLinkedBase     ):

				"""simple docstring"""




				def     lowercase__       (					self						:   Dict  ):

								'''simple docstring'''
								if self.is_empty():
												raise Exception('''List is empty'''  )
								return self._header._next._data




				def     lowercase__       (					self						:   Dict  ):

								'''simple docstring'''
								if self.is_empty():
												raise Exception('''List is empty'''  )
								return self._trailer._prev._data




				def     lowercase__       (					self						:   str,  lowerCamelCase						:   Optional[int]  ):

								'''simple docstring'''
								return self._insert(self._header,  snake_case_,  self._header._next  )




				def     lowercase__       (					self						:   List[Any],  lowerCamelCase						:   Any  ):

								'''simple docstring'''
								return self._insert(self._trailer._prev,  snake_case_,  self._trailer  )




				def     lowercase__       (					self						:   Dict  ):

								'''simple docstring'''
								if self.is_empty():
												raise IndexError('''remove_first from empty list'''  )
								return self._delete(self._header._next  )




				def     lowercase__       (					self						:   Any  ):

								'''simple docstring'''
								if self.is_empty():
												raise IndexError('''remove_first from empty list'''  )
								return self._delete(self._trailer._prev  )












from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


A__     :      Dict             =			{'configuration_sew_d': ['SEW_D_PRETRAINED_CONFIG_ARCHIVE_MAP', 'SEWDConfig']}

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							A__     :      Union[str, Any]             =			[
							    'SEW_D_PRETRAINED_MODEL_ARCHIVE_LIST',
							    'SEWDForCTC',
							    'SEWDForSequenceClassification',
							    'SEWDModel',
							    'SEWDPreTrainedModel',
							]

if TYPE_CHECKING:
							from .configuration_sew_d import SEW_D_PRETRAINED_CONFIG_ARCHIVE_MAP, SEWDConfig

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_sew_d import (
														    SEW_D_PRETRAINED_MODEL_ARCHIVE_LIST,
														    SEWDForCTC,
														    SEWDForSequenceClassification,
														    SEWDModel,
														    SEWDPreTrainedModel,
														)


else:
							import sys

							A__     :      Tuple             =			_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)




