class  __lowerCAmelCase	:



 '''simple docstring'''




 class  __lowerCAmelCase	:



  '''simple docstring'''
  _lowerCamelCase    :						Tuple					     =			'_prev', '_data', '_next'

  def __init__(      self							:		int							,      lowerCamelCase							:		List[Any]							,      lowerCamelCase							:		Any							,      lowerCamelCase							:		Union[str, Any]	)			->				List[Any]:
         _UpperCamelCase  :							str	    =	link_p
         _UpperCamelCase  :							Union[str, Any]	    =	element
         _UpperCamelCase  :							Tuple	    =	link_n

  def        __snake_case       (      self							:		Optional[int]	)			->				Optional[int]:
         return (
             f" Prev -> {self._prev is not None}, Next -> {self._next is not None}"
         )







 def __init__(      self							:		Optional[Any]	)			->				Union[str, Any]:
        _UpperCamelCase  :							int	    =	self._Node(lowerCamelCase							,      lowerCamelCase							,      lowerCamelCase	)
        _UpperCamelCase  :							str	    =	self._Node(lowerCamelCase							,      lowerCamelCase							,      lowerCamelCase	)
        _UpperCamelCase  :							List[Any]	    =	self._trailer
        _UpperCamelCase  :							List[Any]	    =	self._header
        _UpperCamelCase  :							Dict	    =	0

 def __len__(      self							:		List[str]	)			->				str:
        return self._size

 def        __snake_case       (      self							:		Dict	)			->				Union[str, Any]:
        return self.__len__() == 0

 def        __snake_case       (      self							:		Any							,      lowerCamelCase							:		str							,      lowerCamelCase							:		Any							,      lowerCamelCase							:		Union[str, Any]	)			->				Optional[Any]:
        # Create new_node by setting it's prev.link -> header
        # setting it's next.link -> trailer
        _UpperCamelCase  :							List[Any]	    =	self._Node(lowerCamelCase							,      lowerCamelCase							,      lowerCamelCase	)
        _UpperCamelCase  :							Tuple	    =	new_node
        _UpperCamelCase  :							Tuple	    =	new_node
        self._size += 1
        return self

 def        __snake_case       (      self							:		int							,      lowerCamelCase							:		Any	)			->				Union[str, Any]:
        _UpperCamelCase  :							int	    =	node._prev
        _UpperCamelCase  :							List[Any]	    =	node._next

        _UpperCamelCase  :							Any	    =	successor
        _UpperCamelCase  :							Dict	    =	predecessor
        self._size -= 1
        _UpperCamelCase  :							int	    =	node._data
        _UpperCamelCase  :							Tuple	    =	None
        del node
        return temp







class  __lowerCAmelCase	(							_DoublyLinkedBase    ):



 '''simple docstring'''

 def        __snake_case       (      self							:		List[str]	)			->				Optional[int]:
        if self.is_empty():
               raise Exception('List is empty'	)
        return self._header._next._data

 def        __snake_case       (      self							:		Optional[int]	)			->				List[str]:
        if self.is_empty():
               raise Exception('List is empty'	)
        return self._trailer._prev._data

 def        __snake_case       (      self							:		List[Any]							,      lowerCamelCase							:		List[Any]	)			->				int:
        return self._insert(self._header							,      lowerCamelCase							,      self._header._next	)

 def        __snake_case       (      self							:		Tuple							,      lowerCamelCase							:		Tuple	)			->				Any:
        return self._insert(self._trailer._prev							,      lowerCamelCase							,      self._trailer	)

 def        __snake_case       (      self							:		int	)			->				Dict:
        if self.is_empty():
               raise IndexError('remove_first from empty list'	)
        return self._delete(self._header._next	)

 def        __snake_case       (      self							:		Any	)			->				str:
        if self.is_empty():
               raise IndexError('remove_first from empty list'	)
        return self._delete(self._trailer._prev	)








from typing import TYPE_CHECKING

# rely on isort to merge the imports
from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_sentencepiece_available, is_torch_available


__UpperCAmelCase    	=  {
    '''configuration_ernie_m''': ['''ERNIE_M_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''ErnieMConfig'''],
}

try:
		if not is_sentencepiece_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		__UpperCAmelCase    	=  ['''ErnieMTokenizer''']

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		__UpperCAmelCase    	=  [
		    '''ERNIE_M_PRETRAINED_MODEL_ARCHIVE_LIST''',
		    '''ErnieMForMultipleChoice''',
		    '''ErnieMForQuestionAnswering''',
		    '''ErnieMForSequenceClassification''',
		    '''ErnieMForTokenClassification''',
		    '''ErnieMModel''',
		    '''ErnieMPreTrainedModel''',
		    '''ErnieMForInformationExtraction''',
		]


if TYPE_CHECKING:
		from .configuration_ernie_m import ERNIE_M_PRETRAINED_CONFIG_ARCHIVE_MAP, ErnieMConfig

		try:
				if not is_sentencepiece_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .tokenization_ernie_m import ErnieMTokenizer

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_ernie_m import (
				    ERNIE_M_PRETRAINED_MODEL_ARCHIVE_LIST,
				    ErnieMForInformationExtraction,
				    ErnieMForMultipleChoice,
				    ErnieMForQuestionAnswering,
				    ErnieMForSequenceClassification,
				    ErnieMForTokenClassification,
				    ErnieMModel,
				    ErnieMPreTrainedModel,
				)


else:
		import sys

		__UpperCAmelCase    	=  _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)





