




class     a__ :




     class     a__ :
          a	:    List[str]	      =			"""_prev""", """_data""", """_next"""







          def __init__(			self						,	A						,	A						,	A				)						->					str:



               '''simple docstring'''



               a											=   link_p
               a											=   element
               a											=   link_n







          def     lowerCAmelCase_       (			self				)						->					Union[str, Any]:



               '''simple docstring'''



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







     def __init__(			self				)						->					Dict:



          '''simple docstring'''



          a											=   self._Node(A						,	A						,	A				)
          a											=   self._Node(A						,	A						,	A				)
          a											=   self._trailer
          a											=   self._header
          a											=   0







     def __len__(			self				)						->					List[Any]:



          '''simple docstring'''



          return self._size







     def     lowerCAmelCase_       (			self				)						->					Optional[int]:



          '''simple docstring'''



          return self.__len__() == 0







     def     lowerCAmelCase_       (			self						,	A						,	A						,	A				)						->					Dict:



          '''simple docstring'''



          a											=   self._Node(A						,	A						,	A				)
          a											=   new_node
          a											=   new_node
          self._size += 1
          return self







     def     lowerCAmelCase_       (			self						,	A				)						->					Any:



          '''simple docstring'''



          a											=   node._prev
          a											=   node._next

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







class     a__ (      _DoublyLinkedBase   ):







     def     lowerCAmelCase_       (			self				)						->					Any:



          '''simple docstring'''



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







     def     lowerCAmelCase_       (			self				)						->					List[str]:



          '''simple docstring'''



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







     def     lowerCAmelCase_       (			self						,	A				)						->					Optional[Any]:



          '''simple docstring'''



          return self._insert(self._header						,	A						,	self._header._next				)







     def     lowerCAmelCase_       (			self						,	A				)						->					List[Any]:



          '''simple docstring'''



          return self._insert(self._trailer._prev						,	A						,	self._trailer				)







     def     lowerCAmelCase_       (			self				)						->					List[str]:



          '''simple docstring'''



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







     def     lowerCAmelCase_       (			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,
)


lowercase__   :    str 					=      {
    "configuration_rwkv": ["RWKV_PRETRAINED_CONFIG_ARCHIVE_MAP", "RwkvConfig", "RwkvOnnxConfig"],
}

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   lowercase__   :    int 					=      [
       "RWKV_PRETRAINED_MODEL_ARCHIVE_LIST",
       "RwkvForCausalLM",
       "RwkvModel",
       "RwkvPreTrainedModel",
   ]


if TYPE_CHECKING:
   from .configuration_rwkv import RWKV_PRETRAINED_CONFIG_ARCHIVE_MAP, RwkvConfig, RwkvOnnxConfig

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_rwkv import (
          RWKV_PRETRAINED_MODEL_ARCHIVE_LIST,
          RwkvForCausalLM,
          RwkvModel,
          RwkvPreTrainedModel,
      )
else:
   import sys

   lowercase__   :    List[Any] 					=      _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)

