"""simple docstring"""



class 				snake_case__     :


	def __init__(				self  ,						lowerCamelCase		):
								__a     				=  set_counts
								__a     				=  max(_snake_case		)
								__a     				=  len(_snake_case		)
								__a     				=  [1] * num_sets
								__a     				=  list(range(_snake_case		)		)


	def 		a__ (				self  ,						lowerCamelCase  ,						lowerCamelCase		):
								__a     				=  self.get_parent(_snake_case		)
								__a     				=  self.get_parent(_snake_case		)

								if src_parent == dst_parent:
															return False

								if self.ranks[dst_parent] >= self.ranks[src_parent]:
															self.set_counts[dst_parent] += self.set_counts[src_parent]
															__a     				=  0
															__a     				=  dst_parent
															if self.ranks[dst_parent] == self.ranks[src_parent]:
																						self.ranks[dst_parent] += 1
															__a     				=  self.set_counts[dst_parent]
								else:
															self.set_counts[src_parent] += self.set_counts[dst_parent]
															__a     				=  0
															__a     				=  src_parent
															__a     				=  self.set_counts[src_parent]

								__a     				=  max(self.max_set  ,						_snake_case		)
								return True






	def 		a__ (				self  ,						lowerCamelCase		):
								if self.parents[disj_set] == disj_set:
															return disj_set
								__a     				=  self.get_parent(self.parents[disj_set]		)
								return self.parents[disj_set]

"""simple docstring"""



from ...processing_utils import ProcessorMixin






class 				snake_case__     (   snake_case_   ):
 _snake_case   :			List[str]           =		"""WhisperFeatureExtractor"""
 _snake_case   :			Any           =		"""WhisperTokenizer"""


 def __init__(				self  ,						lowerCamelCase  ,						lowerCamelCase		):
        super().__init__(lowerCamelCase  ,						lowerCamelCase		)
        __a     				=  self.feature_extractor
        __a     				=  False


 def 		a__ (				self  ,						lowerCamelCase=None  ,						lowerCamelCase=None  ,						lowerCamelCase=True		):
        return self.tokenizer.get_decoder_prompt_ids(task=lowerCamelCase  ,						language=lowerCamelCase  ,						no_timestamps=lowerCamelCase		)


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

        __a     				=  kwargs.pop("audio"  ,						lowerCamelCase		)
        __a     				=  kwargs.pop("sampling_rate"  ,						lowerCamelCase		)
        __a     				=  kwargs.pop("text"  ,						lowerCamelCase		)
        if len(lowerCamelCase		) > 0:
               __a     				=  args[0]
               __a     				=  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:
               __a     				=  self.feature_extractor(lowerCamelCase  ,						*lowerCamelCase  ,						sampling_rate=lowerCamelCase  ,						**lowerCamelCase		)
        if text is not None:
               __a     				=  self.tokenizer(lowerCamelCase  ,						**lowerCamelCase		)

        if text is None:
               return inputs

        elif audio is None:
               return encodings
        else:
               __a     				=  encodings["input_ids"]
               return inputs


 def 		a__ (				self  ,						*lowerCamelCase  ,						**lowerCamelCase		):
        return self.tokenizer.batch_decode(*lowerCamelCase  ,						**lowerCamelCase		)


 def 		a__ (				self  ,						*lowerCamelCase  ,						**lowerCamelCase		):
        return self.tokenizer.decode(*lowerCamelCase  ,						**lowerCamelCase		)






 def 		a__ (				self  ,						lowerCamelCase  ,						lowerCamelCase="np"		):
        return self.tokenizer.get_prompt_ids(lowerCamelCase  ,						return_tensors=lowerCamelCase		)
