'''simple docstring'''
class 			__lowercase		:







     """simple docstring"""






     def __init__(		self     ,			_lowerCamelCase     ,			_lowerCamelCase=None     ,			_lowerCamelCase=None    ):
         __UpperCamelCase	:	int		    =  data
         __UpperCamelCase	:	str		    =  previous
         __UpperCamelCase	:	List[Any]		    =  next_node







     def __str__(		self    ):
         return f"""{self.data}"""







     def lowerCAmelCase     (		self    ):
         return self.data







     def lowerCAmelCase     (		self    ):
         return self.next







     def lowerCAmelCase     (		self    ):
         return self.previous






class 			__lowercase		:







     """simple docstring"""






     def __init__(		self     ,			_lowerCamelCase    ):
         __UpperCamelCase	:	str		    =  head







     def __iter__(		self    ):
         return self







     def lowerCAmelCase     (		self    ):
         if not self.current:
             raise StopIteration
         else:
             __UpperCamelCase	:	Optional[Any]		    =  self.current.get_data()
             __UpperCamelCase	:	List[Any]		    =  self.current.get_next()
             return value






class 			__lowercase		:







     """simple docstring"""






     def __init__(		self    ):
         __UpperCamelCase	:	Optional[Any]		    =  None  # First node in list
         __UpperCamelCase	:	Optional[Any]		    =  None  # Last node in list







     def __str__(		self    ):
         __UpperCamelCase	:	Optional[int]		    =  self.head
         __UpperCamelCase	:	str		    =  []
         while current is not None:
             nodes.append(current.get_data()    )
             __UpperCamelCase	:	str		    =  current.get_next()
         return " ".join(str(_lowerCamelCase    ) for node in nodes    )







     def __contains__(		self     ,			_lowerCamelCase    ):
         __UpperCamelCase	:	Tuple		    =  self.head
         while current:
             if current.get_data() == value:
                 return True
             __UpperCamelCase	:	Optional[int]		    =  current.get_next()
         return False







     def __iter__(		self    ):
         return LinkedListIterator(self.head    )







     def lowerCAmelCase     (		self    ):
         if self.head:
             return self.head.get_data()
         return None







     def lowerCAmelCase     (		self    ):
         if self.tail:
             return self.tail.get_data()
         return None







     def lowerCAmelCase     (		self     ,			_lowerCamelCase    ):
         if self.head is None:
             __UpperCamelCase	:	Optional[Any]		    =  node
             __UpperCamelCase	:	Dict		    =  node
         else:
             self.insert_before_node(self.head     ,			_lowerCamelCase    )







     def lowerCAmelCase     (		self     ,			_lowerCamelCase    ):
         if self.head is None:
             self.set_head(_lowerCamelCase    )
         else:
             self.insert_after_node(self.tail     ,			_lowerCamelCase    )







     def lowerCAmelCase     (		self     ,			_lowerCamelCase    ):
         __UpperCamelCase	:	Union[str, Any]		    =  Node(_lowerCamelCase    )
         if self.head is None:
             self.set_head(_lowerCamelCase    )
         else:
             self.set_tail(_lowerCamelCase    )







     def lowerCAmelCase     (		self     ,			_lowerCamelCase     ,			_lowerCamelCase    ):
         __UpperCamelCase	:	Tuple		    =  node
         __UpperCamelCase	:	str		    =  node.previous

         if node.get_previous() is None:
             __UpperCamelCase	:	str		    =  node_to_insert
         else:
             __UpperCamelCase	:	Optional[Any]		    =  node_to_insert

         __UpperCamelCase	:	Dict		    =  node_to_insert







     def lowerCAmelCase     (		self     ,			_lowerCamelCase     ,			_lowerCamelCase    ):
         __UpperCamelCase	:	Any		    =  node
         __UpperCamelCase	:	Tuple		    =  node.next

         if node.get_next() is None:
             __UpperCamelCase	:	Dict		    =  node_to_insert
         else:
             __UpperCamelCase	:	Tuple		    =  node_to_insert

         __UpperCamelCase	:	int		    =  node_to_insert







     def lowerCAmelCase     (		self     ,			_lowerCamelCase     ,			_lowerCamelCase    ):
         __UpperCamelCase	:	Optional[int]		    =  1
         __UpperCamelCase	:	Dict		    =  Node(_lowerCamelCase    )
         __UpperCamelCase	:	List[str]		    =  self.head
         while node:
             if current_position == position:
                 self.insert_before_node(_lowerCamelCase     ,			_lowerCamelCase    )
                 return
             current_position += 1
             __UpperCamelCase	:	str		    =  node.next
         self.insert_after_node(self.tail     ,			_lowerCamelCase    )







     def lowerCAmelCase     (		self     ,			_lowerCamelCase    ):
         __UpperCamelCase	:	Optional[Any]		    =  self.head
         while node:
             if node.get_data() == item:
                 return node
             __UpperCamelCase	:	Dict		    =  node.get_next()
         raise Exception('Node not found'    )







     def lowerCAmelCase     (		self     ,			_lowerCamelCase    ):
         if (node := self.get_node(_lowerCamelCase    )) is not None:
             if node == self.head:
                 __UpperCamelCase	:	Any		    =  self.head.get_next()

             if node == self.tail:
                 __UpperCamelCase	:	str		    =  self.tail.get_previous()

             self.remove_node_pointers(_lowerCamelCase    )







     @staticmethod
     def lowerCAmelCase     (		_lowerCamelCase    ):
         if node.get_next():
             __UpperCamelCase	:	Union[str, Any]		    =  node.previous

         if node.get_previous():
             __UpperCamelCase	:	Union[str, Any]		    =  node.next

         __UpperCamelCase	:	int		    =  None
         __UpperCamelCase	:	Optional[Any]		    =  None







     def lowerCAmelCase     (		self    ):
         return self.head is None







def  _UpperCamelCase (     ):




    """simple docstring"""





if __name__ == "__main__":
  import doctest

  doctest.testmod()




'''simple docstring'''
from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_sentencepiece_available,
    is_tokenizers_available,
    is_torch_available,
)


a=  {}

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

try:
  if not is_tokenizers_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  a=  ['''NllbTokenizerFast''']


if TYPE_CHECKING:
  try:
    if not is_sentencepiece_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .tokenization_nllb import NllbTokenizer

  try:
    if not is_tokenizers_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .tokenization_nllb_fast import NllbTokenizerFast

else:
  import sys

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



