




import warnings
from contextlib import contextmanager

from ....processing_utils import ProcessorMixin




class       _A				(		__lowercase     ):
		__a					    =       """MCTCTFeatureExtractor"""
		__a					    =       """AutoTokenizer"""






		def __init__(    self						,		_SCREAMING_SNAKE_CASE						,		_SCREAMING_SNAKE_CASE			):
								super().__init__(_SCREAMING_SNAKE_CASE						,		_SCREAMING_SNAKE_CASE			)
								_UpperCAmelCase      =			self.feature_extractor
								_UpperCAmelCase      =			False






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

								if "raw_speech" in kwargs:
														warnings.warn("""Using `raw_speech` as a keyword argument is deprecated. Use `audio` instead."""			)
														_UpperCAmelCase      =			kwargs.pop("""raw_speech"""			)
								else:
														_UpperCAmelCase      =			kwargs.pop("""audio"""						,		_SCREAMING_SNAKE_CASE			)
								_UpperCAmelCase      =			kwargs.pop("""sampling_rate"""						,		_SCREAMING_SNAKE_CASE			)
								_UpperCAmelCase      =			kwargs.pop("""text"""						,		_SCREAMING_SNAKE_CASE			)
								if len(_SCREAMING_SNAKE_CASE			) > 0:
														_UpperCAmelCase      =			args[0]
														_UpperCAmelCase      =			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:
														_UpperCAmelCase      =			self.feature_extractor(_SCREAMING_SNAKE_CASE						,		*_SCREAMING_SNAKE_CASE						,		sampling_rate=_SCREAMING_SNAKE_CASE						,		**_SCREAMING_SNAKE_CASE			)
								if text is not None:
														_UpperCAmelCase      =			self.tokenizer(_SCREAMING_SNAKE_CASE						,		**_SCREAMING_SNAKE_CASE			)

								if text is None:
														return inputs
								elif audio is None:
														return encodings
								else:
														_UpperCAmelCase      =			encodings["""input_ids"""]
														return inputs






		def 				UpperCAmelCase (    self						,		*_SCREAMING_SNAKE_CASE						,		**_SCREAMING_SNAKE_CASE			):
								return self.tokenizer.batch_decode(*_SCREAMING_SNAKE_CASE						,		**_SCREAMING_SNAKE_CASE			)






		def 				UpperCAmelCase (    self						,		*_SCREAMING_SNAKE_CASE						,		**_SCREAMING_SNAKE_CASE			):
								# For backward compatibility
								if self._in_target_context_manager:
														return self.current_processor.pad(*_SCREAMING_SNAKE_CASE						,		**_SCREAMING_SNAKE_CASE			)

								_UpperCAmelCase      =			kwargs.pop("""input_features"""						,		_SCREAMING_SNAKE_CASE			)
								_UpperCAmelCase      =			kwargs.pop("""labels"""						,		_SCREAMING_SNAKE_CASE			)
								if len(_SCREAMING_SNAKE_CASE			) > 0:
														_UpperCAmelCase      =			args[0]
														_UpperCAmelCase      =			args[1:]

								if input_features is not None:
														_UpperCAmelCase      =			self.feature_extractor.pad(_SCREAMING_SNAKE_CASE						,		*_SCREAMING_SNAKE_CASE						,		**_SCREAMING_SNAKE_CASE			)
								if labels is not None:
														_UpperCAmelCase      =			self.tokenizer.pad(_SCREAMING_SNAKE_CASE						,		**_SCREAMING_SNAKE_CASE			)

								if labels is None:
														return input_features
								elif input_features is None:
														return labels
								else:
														_UpperCAmelCase      =			labels["""input_ids"""]
														return input_features






		def 				UpperCAmelCase (    self						,		*_SCREAMING_SNAKE_CASE						,		**_SCREAMING_SNAKE_CASE			):
								return self.tokenizer.decode(*_SCREAMING_SNAKE_CASE						,		**_SCREAMING_SNAKE_CASE			)






		@contextmanager
		def 				UpperCAmelCase (    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 audio inputs, or in a separate call."""			)
								_UpperCAmelCase      =			True
								_UpperCAmelCase      =			self.tokenizer
								yield
								_UpperCAmelCase      =			self.feature_extractor
								_UpperCAmelCase      =			False





from __future__ import annotations




def        _SCREAMING_SNAKE_CASE      (		snake_case			,     snake_case       )						->				float:
						_UpperCAmelCase      =			sorted(numsa + numsa       )
						_UpperCAmelCase    ,					_UpperCAmelCase      =			divmod(len(snake_case       )			,     2       )
						if mod == 1:
												return all_numbers[div]
						else:
												return (all_numbers[div] + all_numbers[div - 1]) / 2


if __name__ == "__main__":
				import doctest

				doctest.testmod()
				a													=			[float(x) for x in input("Enter the elements of first array: ").split()]
				a													=			[float(x) for x in input("Enter the elements of second array: ").split()]
				print(F'The median of two arrays is: {median_of_two_arrays(array_a, array_a)}')