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	)




"""simple docstring"""


from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


lowerCAmelCase_:       Optional[int]			     =       {"configuration_vit_hybrid": ["VIT_HYBRID_PRETRAINED_CONFIG_ARCHIVE_MAP", "ViTHybridConfig"]}

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 lowerCAmelCase_:       Any			     =       [
     "VIT_HYBRID_PRETRAINED_MODEL_ARCHIVE_LIST",
     "ViTHybridForImageClassification",
     "ViTHybridModel",
     "ViTHybridPreTrainedModel",
 ]

try:
 if not is_vision_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 lowerCAmelCase_:       Optional[Any]			     =       ["ViTHybridImageProcessor"]


if TYPE_CHECKING:
 from .configuration_vit_hybrid import VIT_HYBRID_PRETRAINED_CONFIG_ARCHIVE_MAP, ViTHybridConfig

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_vit_hybrid import (
      VIT_HYBRID_PRETRAINED_MODEL_ARCHIVE_LIST,
      ViTHybridForImageClassification,
      ViTHybridModel,
      ViTHybridPreTrainedModel,
  )

 try:
  if not is_vision_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .image_processing_vit_hybrid import ViTHybridImageProcessor


else:
 import sys

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




