
class 							lowercase						:







							class 							lowercase						:
														lowercase_			:			Tuple			   ='''_prev''', '''_data''', '''_next'''




														def __init__(							self  ,A__  ,A__  ,A__):
																			lowercase		      =		link_p
																			lowercase		      =		element
																			lowercase		      =		link_n





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




							def __init__(							self):
												lowercase		      =		self._Node(A__  ,A__  ,A__)
												lowercase		      =		self._Node(A__  ,A__  ,A__)
												lowercase		      =		self._trailer
												lowercase		      =		self._header
												lowercase		      =		0




							def __len__(							self):
												return self._size




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




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





							def 					A__ (							self  ,A__):
												lowercase		      =		node._prev
												lowercase		      =		node._next

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







class 							lowercase						(   _DoublyLinkedBase						):




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




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




							def 					A__ (							self  ,A__):
												return self._insert(self._header  ,A__  ,self._header._next)




							def 					A__ (							self  ,A__):
												return self._insert(self._trailer._prev  ,A__  ,self._trailer)




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





							def 					A__ (							self):
												if self.is_empty():
																	raise IndexError('''remove_first from empty list''')
												return self._delete(self._trailer._prev)






import warnings
from contextlib import contextmanager

from ...processing_utils import ProcessorMixin







class 							lowercase						(   SCREAMING_SNAKE_CASE__						):
							lowercase_			:			Dict			   =['''image_processor''', '''tokenizer''']
							lowercase_			:			List[str]			   ='''AutoImageProcessor'''
							lowercase_			:			Optional[Any]			   ='''AutoTokenizer'''




							def __init__(							self  ,A__=None  ,A__=None  ,**A__):
												lowercase		      =		None
												if "feature_extractor" in kwargs:
																	warnings.warn(
																	    '''The `feature_extractor` argument is deprecated and will be removed in v5, use `image_processor`'''
																	    ''' instead.'''  ,A__  ,)
																	lowercase		      =		kwargs.pop('''feature_extractor''')

												lowercase		      =		image_processor if image_processor is not None else feature_extractor
												if image_processor is None:
																	raise ValueError('''You need to specify an `image_processor`.''')
												if tokenizer is None:
																	raise ValueError('''You need to specify a `tokenizer`.''')

												super().__init__(A__  ,A__)
												lowercase		      =		self.image_processor
												lowercase		      =		False




							def __call__(							self  ,*A__  ,**A__):
												# For backward compatibility
												if self._in_target_context_manager:
																	return self.current_processor(*A__  ,**A__)

												lowercase		      =		kwargs.pop('''images'''  ,A__)
												lowercase		      =		kwargs.pop('''text'''  ,A__)
												if len(A__) > 0:
																	lowercase		      =		args[0]
																	lowercase		      =		args[1:]

												if images is None and text is None:
																	raise ValueError('''You need to specify either an `images` or `text` input to process.''')

												if images is not None:
																	lowercase		      =		self.image_processor(A__  ,*A__  ,**A__)
												if text is not None:
																	lowercase		      =		self.tokenizer(A__  ,**A__)

												if text is None:
																	return inputs
												elif images is None:
																	return encodings
												else:
																	lowercase		      =		encodings['''input_ids''']
																	return inputs




							def 					A__ (							self  ,*A__  ,**A__):
												return self.tokenizer.batch_decode(*A__  ,**A__)




							def 					A__ (							self  ,*A__  ,**A__):
												return self.tokenizer.decode(*A__  ,**A__)




							@contextmanager
							def 					A__ (							self):
												warnings.warn(
												    '''`as_target_processor` is deprecated and will be removed in v5 of Transformers. You can process your '''
												    '''labels by using the argument `text` of the regular `__call__` method (either in the same call as '''
												    '''your images inputs, or in a separate call.''')
												lowercase		      =		True
												lowercase		      =		self.tokenizer
												yield
												lowercase		      =		self.image_processor
												lowercase		      =		False




							@property
							def 					A__ (							self):
												warnings.warn(
												    '''`feature_extractor_class` is deprecated and will be removed in v5. Use `image_processor_class` instead.'''  ,A__  ,)
												return self.image_processor_class





							@property
							def 					A__ (							self):
												warnings.warn(
												    '''`feature_extractor` is deprecated and will be removed in v5. Use `image_processor` instead.'''  ,A__  ,)
												return self.image_processor




