
'''simple docstring'''




class  A				:





     def __init__(							self						,			SCREAMING_SNAKE_CASE						,			SCREAMING_SNAKE_CASE=None						,			SCREAMING_SNAKE_CASE=None	) ->				Any:






         """simple docstring"""






         A       :   Tuple					=						data
         A       :   Optional[Any]					=						previous
         A       :   Union[str, Any]					=						next_node





     def __str__(							self	) ->				str:






         """simple docstring"""






         return F'{self.data}'





     def 				__lowerCAmelCase							(							self	) ->				int:






         """simple docstring"""






         return self.data





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






         """simple docstring"""






         return self.next





     def 				__lowerCAmelCase							(							self	) ->				Tuple:






         """simple docstring"""






         return self.previous





class  A				:





     def __init__(							self						,			SCREAMING_SNAKE_CASE	) ->				Optional[Any]:






         """simple docstring"""






         A       :   List[str]					=						head





     def __iter__(							self	) ->				Any:






         """simple docstring"""






         return self





     def 				__lowerCAmelCase							(							self	) ->				int:






         """simple docstring"""






         if not self.current:
             raise StopIteration
         else:
             A       :   List[str]					=						self.current.get_data()
             A       :   Union[str, Any]					=						self.current.get_next()
             return value





class  A				:





     def __init__(							self	) ->				Optional[Any]:






         """simple docstring"""






         A       :   int					=						None  # First node in list
         A       :   str					=						None  # Last node in list





     def __str__(							self	) ->				int:






         """simple docstring"""






         A       :   int					=						self.head
         A       :   Optional[int]					=						[]
         while current is not None:
             nodes.append(current.get_data()	)
             A       :   List[str]					=						current.get_next()
         return " ".join(str(SCREAMING_SNAKE_CASE	) for node in nodes	)





     def __contains__(							self						,			SCREAMING_SNAKE_CASE	) ->				str:






         """simple docstring"""






         A       :   str					=						self.head
         while current:
             if current.get_data() == value:
                 return True
             A       :   Optional[int]					=						current.get_next()
         return False





     def __iter__(							self	) ->				int:






         """simple docstring"""






         return LinkedListIterator(self.head	)





     def 				__lowerCAmelCase							(							self	) ->				Tuple:






         """simple docstring"""






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





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






         """simple docstring"""






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





     def 				__lowerCAmelCase							(							self						,			SCREAMING_SNAKE_CASE	) ->				None:






         """simple docstring"""






         if self.head is None:
             A       :   Any					=						node
             A       :   List[Any]					=						node
         else:
             self.insert_before_node(self.head						,			SCREAMING_SNAKE_CASE	)





     def 				__lowerCAmelCase							(							self						,			SCREAMING_SNAKE_CASE	) ->				None:






         """simple docstring"""






         if self.head is None:
             self.set_head(SCREAMING_SNAKE_CASE	)
         else:
             self.insert_after_node(self.tail						,			SCREAMING_SNAKE_CASE	)





     def 				__lowerCAmelCase							(							self						,			SCREAMING_SNAKE_CASE	) ->				None:






         """simple docstring"""






         A       :   List[Any]					=						Node(SCREAMING_SNAKE_CASE	)
         if self.head is None:
             self.set_head(SCREAMING_SNAKE_CASE	)
         else:
             self.set_tail(SCREAMING_SNAKE_CASE	)





     def 				__lowerCAmelCase							(							self						,			SCREAMING_SNAKE_CASE						,			SCREAMING_SNAKE_CASE	) ->				None:






         """simple docstring"""






         A       :   Tuple					=						node
         A       :   int					=						node.previous

         if node.get_previous() is None:
             A       :   int					=						node_to_insert
         else:
             A       :   Tuple					=						node_to_insert

         A       :   Optional[int]					=						node_to_insert





     def 				__lowerCAmelCase							(							self						,			SCREAMING_SNAKE_CASE						,			SCREAMING_SNAKE_CASE	) ->				None:






         """simple docstring"""






         A       :   Tuple					=						node
         A       :   int					=						node.next

         if node.get_next() is None:
             A       :   Optional[int]					=						node_to_insert
         else:
             A       :   Tuple					=						node_to_insert

         A       :   List[str]					=						node_to_insert





     def 				__lowerCAmelCase							(							self						,			SCREAMING_SNAKE_CASE						,			SCREAMING_SNAKE_CASE	) ->				None:






         """simple docstring"""






         A       :   int					=						1
         A       :   int					=						Node(SCREAMING_SNAKE_CASE	)
         A       :   List[str]					=						self.head
         while node:
             if current_position == position:
                 self.insert_before_node(SCREAMING_SNAKE_CASE						,			SCREAMING_SNAKE_CASE	)
                 return
             current_position += 1
             A       :   Any					=						node.next
         self.insert_after_node(self.tail						,			SCREAMING_SNAKE_CASE	)





     def 				__lowerCAmelCase							(							self						,			SCREAMING_SNAKE_CASE	) ->				Node:






         """simple docstring"""






         A       :   str					=						self.head
         while node:
             if node.get_data() == item:
                 return node
             A       :   int					=						node.get_next()
         raise Exception('''Node not found'''	)





     def 				__lowerCAmelCase							(							self						,			SCREAMING_SNAKE_CASE	) ->				Dict:






         """simple docstring"""






         if (node := self.get_node(SCREAMING_SNAKE_CASE	)) is not None:
             if node == self.head:
                 A       :   Optional[Any]					=						self.head.get_next()

             if node == self.tail:
                 A       :   Union[str, Any]					=						self.tail.get_previous()

             self.remove_node_pointers(SCREAMING_SNAKE_CASE	)





     @staticmethod
     def 				__lowerCAmelCase							(							SCREAMING_SNAKE_CASE	) ->				None:






         """simple docstring"""






         if node.get_next():
             A       :   Union[str, Any]					=						node.previous

         if node.get_previous():
             A       :   Optional[int]					=						node.next

         A       :   int					=						None
         A       :   Optional[int]					=						None





     def 				__lowerCAmelCase							(							self	) ->				int:






         """simple docstring"""






         return self.head is None







def 		lowerCAmelCase_				(   ):




    '''simple docstring'''





if __name__ == "__main__":
      import doctest

      doctest.testmod()








from typing import TYPE_CHECKING

from ...utils import _LazyModule


_A		       =						{'tokenization_wav2vec2_phoneme': ['Wav2Vec2PhonemeCTCTokenizer']}


if TYPE_CHECKING:
   from .tokenization_wavaveca_phoneme import WavaVecaPhonemeCTCTokenizer
else:
   import sys

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





