

'''simple docstring'''



from ...processing_utils import ProcessorMixin

class       SCREAMING_SNAKE_CASE       (				_SCREAMING_SNAKE_CASE       ):






      '''simple docstring'''






      SCREAMING_SNAKE_CASE__			:					Optional[int]     =					"""WhisperFeatureExtractor"""
      SCREAMING_SNAKE_CASE__			:					List[str]     =					"""WhisperTokenizer"""




      def __init__(       self			:		Dict  ,       snake_case			:		Tuple  ,       snake_case			:		Optional[int] ):



          """simple docstring"""





          super().__init__(lowerCAmelCase_  ,       lowerCAmelCase_ )
          _snake_case			:			Any				       =		self.feature_extractor
          _snake_case			:			Dict				       =		False




      def 						__UpperCAmelCase      (       self			:		List[Any]  ,       snake_case			:		Optional[int]=None  ,       snake_case			:		List[Any]=None  ,       snake_case			:		Optional[Any]=True ):



          """simple docstring"""





          return self.tokenizer.get_decoder_prompt_ids(task=lowerCAmelCase_  ,       language=lowerCAmelCase_  ,       no_timestamps=lowerCAmelCase_ )




      def __call__(       self			:		Any  ,       *snake_case			:		Tuple  ,       **snake_case			:		Any ):



          """simple docstring"""





          if self._in_target_context_manager:
              return self.current_processor(*lowerCAmelCase_  ,       **lowerCAmelCase_ )

          _snake_case			:			Any				       =		kwargs.pop('audio'  ,       lowerCAmelCase_ )
          _snake_case			:			Dict				       =		kwargs.pop('sampling_rate'  ,       lowerCAmelCase_ )
          _snake_case			:			int				       =		kwargs.pop('text'  ,       lowerCAmelCase_ )
          if len(lowerCAmelCase_ ) > 0:
              _snake_case			:			Dict				       =		args[0]
              _snake_case			:			int				       =		args[1:]

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

          if audio is not None:
              _snake_case			:			Optional[Any]				       =		self.feature_extractor(lowerCAmelCase_  ,       *lowerCAmelCase_  ,       sampling_rate=lowerCAmelCase_  ,       **lowerCAmelCase_ )
          if text is not None:
              _snake_case			:			int				       =		self.tokenizer(lowerCAmelCase_  ,       **lowerCAmelCase_ )

          if text is None:
              return inputs

          elif audio is None:
              return encodings
          else:
              _snake_case			:			Optional[Any]				       =		encodings["""input_ids"""]
              return inputs




      def 						__UpperCAmelCase      (       self			:		List[str]  ,       *snake_case			:		Optional[int]  ,       **snake_case			:		Optional[Any] ):



          """simple docstring"""





          return self.tokenizer.batch_decode(*lowerCAmelCase_  ,       **lowerCAmelCase_ )




      def 						__UpperCAmelCase      (       self			:		Optional[Any]  ,       *snake_case			:		Dict  ,       **snake_case			:		Union[str, Any] ):



          """simple docstring"""





          return self.tokenizer.decode(*lowerCAmelCase_  ,       **lowerCAmelCase_ )




      def 						__UpperCAmelCase      (       self			:		Optional[int]  ,       snake_case			:		Dict  ,       snake_case			:		Tuple="np" ):



          """simple docstring"""





          return self.tokenizer.get_prompt_ids(lowerCAmelCase_  ,       return_tensors=lowerCAmelCase_ )











"""simple docstring"""
class   SCREAMING_SNAKE_CASE	:





	"""simple docstring"""




	def __init__(self  ,  lowerCAmelCase_  ,  lowerCAmelCase_=None  ,  lowerCAmelCase_=None				):
		A_		:    Dict						     = data
		A_		:    Dict						     = previous
		A_		:    int						     = 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   SCREAMING_SNAKE_CASE	:





	"""simple docstring"""




	def __init__(self  ,  lowerCAmelCase_				):
		A_		:    Optional[Any]						     = head





	def __iter__(self				):
		return self





	def  lowerCamelCase(self				):
		if not self.current:
			raise StopIteration
		else:
			A_		:    str						     = self.current.get_data()
			A_		:    List[str]						     = self.current.get_next()
			return value






class   SCREAMING_SNAKE_CASE	:





	"""simple docstring"""




	def __init__(self				):
		A_		:    str						     = None  # First node in list
		A_		:    Tuple						     = None  # Last node in list





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





	def __contains__(self  ,  lowerCAmelCase_				):
		A_		:    Union[str, Any]						     = self.head
		while current:
			if current.get_data() == value:
				return True
			A_		:    Union[str, Any]						     = 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:
			A_		:    str						     = node
			A_		:    Optional[int]						     = 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_				):
		A_		:    List[Any]						     = Node(lowerCAmelCase_				)
		if self.head is None:
			self.set_head(lowerCAmelCase_				)
		else:
			self.set_tail(lowerCAmelCase_				)





	def  lowerCamelCase(self  ,  lowerCAmelCase_  ,  lowerCAmelCase_				):
		A_		:    str						     = node
		A_		:    Union[str, Any]						     = node.previous

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

		A_		:    Any						     = node_to_insert





	def  lowerCamelCase(self  ,  lowerCAmelCase_  ,  lowerCAmelCase_				):
		A_		:    Dict						     = node
		A_		:    Optional[Any]						     = node.next

		if node.get_next() is None:
			A_		:    Optional[int]						     = node_to_insert
		else:
			A_		:    List[Any]						     = node_to_insert

		A_		:    Optional[Any]						     = node_to_insert





	def  lowerCamelCase(self  ,  lowerCAmelCase_  ,  lowerCAmelCase_				):
		A_		:    str						     = 1
		A_		:    Tuple						     = Node(lowerCAmelCase_				)
		A_		:    Dict						     = self.head
		while node:
			if current_position == position:
				self.insert_before_node(lowerCAmelCase_  ,  lowerCAmelCase_				)
				return
			current_position += 1
			A_		:    List[str]						     = node.next
		self.insert_after_node(self.tail  ,  lowerCAmelCase_				)





	def  lowerCamelCase(self  ,  lowerCAmelCase_				):
		A_		:    Dict						     = self.head
		while node:
			if node.get_data() == item:
				return node
			A_		:    Optional[int]						     = 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:
				A_		:    Tuple						     = self.head.get_next()

			if node == self.tail:
				A_		:    Dict						     = self.tail.get_previous()

			self.remove_node_pointers(lowerCAmelCase_				)





	@staticmethod
	def  lowerCamelCase(lowerCAmelCase_				):
		if node.get_next():
			A_		:    Any						     = node.previous

		if node.get_previous():
			A_		:    int						     = node.next

		A_		:    str						     = None
		A_		:    int						     = None





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






def       __UpperCamelCase						(		):
	pass


if __name__ == "__main__":
							import doctest

							doctest.testmod()

