
"""simple docstring"""


class    __lowerCamelCase     :




				class    __lowerCamelCase     :
								a__:			Dict									=						'_prev', '_data', '_next'




								def __init__(							self       ,	UpperCAmelCase       ,	UpperCAmelCase       ,	UpperCAmelCase      ):
											lowerCamelCase_ 		=     link_p
											lowerCamelCase_ 		=     element
											lowerCamelCase_ 		=     link_n





								def 					UpperCAmelCase__	(							self      ):
											return (
											    f" Prev -> {self._prev is not None}, Next -> {self._next is not None}"
											)




				def __init__(							self      ):
							lowerCamelCase_ 		=     self._Node(UpperCAmelCase       ,	UpperCAmelCase       ,	UpperCAmelCase      )
							lowerCamelCase_ 		=     self._Node(UpperCAmelCase       ,	UpperCAmelCase       ,	UpperCAmelCase      )
							lowerCamelCase_ 		=     self._trailer
							lowerCamelCase_ 		=     self._header
							lowerCamelCase_ 		=     0




				def __len__(							self      ):
							return self._size




				def 					UpperCAmelCase__	(							self      ):
							return self.__len__() == 0




				def 					UpperCAmelCase__	(							self       ,	UpperCAmelCase       ,	UpperCAmelCase       ,	UpperCAmelCase      ):
							# Create new_node by setting it's prev.link -> header
							# setting it's next.link -> trailer
							lowerCamelCase_ 		=     self._Node(UpperCAmelCase       ,	UpperCAmelCase       ,	UpperCAmelCase      )
							lowerCamelCase_ 		=     new_node
							lowerCamelCase_ 		=     new_node
							self._size += 1
							return self





				def 					UpperCAmelCase__	(							self       ,	UpperCAmelCase      ):
							lowerCamelCase_ 		=     node._prev
							lowerCamelCase_ 		=     node._next

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




class    __lowerCamelCase     (   _DoublyLinkedBase ):




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




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




				def 					UpperCAmelCase__	(							self       ,	UpperCAmelCase      ):
							return self._insert(self._header       ,	UpperCAmelCase       ,	self._header._next      )




				def 					UpperCAmelCase__	(							self       ,	UpperCAmelCase      ):
							return self._insert(self._trailer._prev       ,	UpperCAmelCase       ,	self._trailer      )




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





				def 					UpperCAmelCase__	(							self      ):
							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


A_						       =				{
    """configuration_flava""": [
        """FLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """FlavaConfig""",
        """FlavaImageCodebookConfig""",
        """FlavaImageConfig""",
        """FlavaMultimodalConfig""",
        """FlavaTextConfig""",
    ],
}

try:
						if not is_vision_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						A_						       =				["""FlavaFeatureExtractor"""]
						A_						       =				["""FlavaImageProcessor"""]
						A_						       =				["""FlavaProcessor"""]

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						A_						       =				[
						    """FLAVA_PRETRAINED_MODEL_ARCHIVE_LIST""",
						    """FlavaForPreTraining""",
						    """FlavaImageCodebook""",
						    """FlavaImageModel""",
						    """FlavaModel""",
						    """FlavaMultimodalModel""",
						    """FlavaPreTrainedModel""",
						    """FlavaTextModel""",
						]

if TYPE_CHECKING:
						from .configuration_flava import (
						    FLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP,
						    FlavaConfig,
						    FlavaImageCodebookConfig,
						    FlavaImageConfig,
						    FlavaMultimodalConfig,
						    FlavaTextConfig,
						)

						try:
												if not is_vision_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .feature_extraction_flava import FlavaFeatureExtractor
												from .image_processing_flava import FlavaImageProcessor
												from .processing_flava import FlavaProcessor

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_flava import (
												    FLAVA_PRETRAINED_MODEL_ARCHIVE_LIST,
												    FlavaForPreTraining,
												    FlavaImageCodebook,
												    FlavaImageModel,
												    FlavaModel,
												    FlavaMultimodalModel,
												    FlavaPreTrainedModel,
												    FlavaTextModel,
												)

else:
						import sys

						A_						       =				_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)



