
from ...processing_utils import ProcessorMixin

class       a		(   __UpperCAmelCase					):
							lowercase_		:						Dict   							=  'WhisperFeatureExtractor'
							lowercase_		:						Any   							=  'WhisperTokenizer'







							def __init__(						self  :  List[Any]      ,				snake_case__  :  int      ,				snake_case__  :  Union[str, Any] ):
								"""simple docstring"""







								super().__init__(snake_case__      ,				snake_case__ )
								__lowerCAmelCase         =							self.feature_extractor
								__lowerCAmelCase         =							False







							def       UpperCAmelCase__					(						self  :  Optional[Any]      ,				snake_case__  :  List[Any]=None      ,				snake_case__  :  int=None      ,				snake_case__  :  List[Any]=True ):
								"""simple docstring"""







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







							def __call__(						self  :  Union[str, Any]      ,				*snake_case__  :  str      ,				**snake_case__  :  str ):
								"""simple docstring"""







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

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

								if text is None:
									return inputs

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







							def       UpperCAmelCase__					(						self  :  Dict      ,				*snake_case__  :  Optional[Any]      ,				**snake_case__  :  Dict ):
								"""simple docstring"""







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







							def       UpperCAmelCase__					(						self  :  Optional[Any]      ,				*snake_case__  :  Any      ,				**snake_case__  :  Tuple ):
								"""simple docstring"""







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







							def       UpperCAmelCase__					(						self  :  Optional[int]      ,				snake_case__  :  str      ,				snake_case__  :  Optional[int]="np" ):
								"""simple docstring"""







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








import math
import sys






def 		_UpperCAmelCase   (	UpperCamelCase:     str  ):






	"""simple docstring"""


	__lowerCAmelCase         =							""
	try:
		with open(UpperCamelCase			,							"rb"  ) as binary_file:
			__lowerCAmelCase         =							binary_file.read()
		for dat in data:
			__lowerCAmelCase         =							F"{dat:08b}"
			result += curr_byte
		return result
	except OSError:
		print("File not accessible"  )
		sys.exit()






def 		_UpperCAmelCase   (	UpperCamelCase:     str  ):






	"""simple docstring"""


	__lowerCAmelCase         =							{"0": "0", "1": "1"}
	__lowerCAmelCase   ,						__lowerCAmelCase         =							"", ""
	__lowerCAmelCase         =							len(UpperCamelCase  )

	for i in range(len(UpperCamelCase  )  ):
		curr_string += data_bits[i]
		if curr_string not in lexicon:
			continue

		__lowerCAmelCase         =							lexicon[curr_string]
		result += last_match_id
		__lowerCAmelCase         =							last_match_id + "0"

		if math.loga(UpperCamelCase  ).is_integer():
			__lowerCAmelCase         =							{}
			for curr_key in list(UpperCamelCase  ):
				__lowerCAmelCase         =							lexicon.pop(UpperCamelCase  )
			__lowerCAmelCase         =							new_lex

		__lowerCAmelCase         =							last_match_id + "1"
		index += 1
		__lowerCAmelCase         =							""
	return result






def 		_UpperCAmelCase   (	UpperCamelCase:     str			,							UpperCamelCase:     str  ):






	"""simple docstring"""


	__lowerCAmelCase         =							8
	try:
		with open(UpperCamelCase			,							"wb"  ) as opened_file:
			__lowerCAmelCase         =							[
			    to_write[i : i + byte_length]
			    for i in range(0			,							len(UpperCamelCase  )			,							UpperCamelCase  )
			]

			if len(result_byte_array[-1]  ) % byte_length == 0:
				result_byte_array.append("10000000"  )
			else:
				result_byte_array[-1] += "1" + "0" * (
				    byte_length - len(result_byte_array[-1]  ) - 1
				)

			for elem in result_byte_array[:-1]:
				opened_file.write(int(UpperCamelCase			,							2  ).to_bytes(1			,							byteorder="big"  )  )
	except OSError:
		print("File not accessible"  )
		sys.exit()






def 		_UpperCAmelCase   (	UpperCamelCase:     str  ):






	"""simple docstring"""


	__lowerCAmelCase         =							0
	for letter in data_bits:
		if letter == "1":
			break
		counter += 1

	__lowerCAmelCase         =							data_bits[counter:]
	__lowerCAmelCase         =							data_bits[counter + 1 :]
	return data_bits






def 		_UpperCAmelCase   (	UpperCamelCase:     str			,							UpperCamelCase:     str  ):






	"""simple docstring"""


	__lowerCAmelCase         =							read_file_binary(UpperCamelCase  )
	__lowerCAmelCase         =							remove_prefix(UpperCamelCase  )
	__lowerCAmelCase         =							decompress_data(UpperCamelCase  )
	write_file_binary(UpperCamelCase			,							UpperCamelCase  )


if __name__ == "__main__":
					compress(sys.argv[1], sys.argv[2])






