






from typing import List, Optional

import numpy as np

from ...processing_utils import ProcessorMixin
from ...utils import to_numpy







class 				UpperCAmelCase_  (		__lowerCamelCase		):
     __lowerCamelCase      				=  'EncodecFeatureExtractor'
     __lowerCamelCase      				=  ('T5Tokenizer', 'T5TokenizerFast')




     def __init__(				self	,						_lowerCAmelCase	,						_lowerCAmelCase		):
          super().__init__(_lowerCAmelCase	,						_lowerCAmelCase		)
          UpperCAmelCase__      :  Union[str, Any]				      =			self.feature_extractor
          UpperCAmelCase__      :  Optional[int]				      =			False




     def   __UpperCAmelCase  (				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		)

          UpperCAmelCase__      :  Optional[int]				      =			kwargs.pop("""audio"""	,						_lowerCAmelCase		)
          UpperCAmelCase__      :  Union[str, Any]				      =			kwargs.pop("""sampling_rate"""	,						_lowerCAmelCase		)
          UpperCAmelCase__      :  int				      =			kwargs.pop("""text"""	,						_lowerCAmelCase		)
          if len(_lowerCAmelCase		) > 0:
               UpperCAmelCase__      :  Union[str, Any]				      =			args[0]
               UpperCAmelCase__      :  Optional[Any]				      =			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 text is not None:
               UpperCAmelCase__      :  Tuple				      =			self.tokenizer(_lowerCAmelCase	,						**_lowerCAmelCase		)

          if audio is not None:
               UpperCAmelCase__      :  Union[str, Any]				      =			self.feature_extractor(_lowerCAmelCase	,						*_lowerCAmelCase	,						sampling_rate=_lowerCAmelCase	,						**_lowerCAmelCase		)

          if audio is None:
               return inputs

          elif text is None:
               return audio_inputs

          else:
               UpperCAmelCase__      :  List[str]				      =			audio_inputs["""input_values"""]
               if "padding_mask" in audio_inputs:
                    UpperCAmelCase__      :  Union[str, Any]				      =			audio_inputs["""padding_mask"""]
               return inputs




     def   __UpperCAmelCase  (				self	,						*_lowerCAmelCase	,						**_lowerCAmelCase		):
          UpperCAmelCase__      :  Any				      =			kwargs.pop("""audio"""	,						_lowerCAmelCase		)
          UpperCAmelCase__      :  Union[str, Any]				      =			kwargs.pop("""padding_mask"""	,						_lowerCAmelCase		)

          if len(_lowerCAmelCase		) > 0:
               UpperCAmelCase__      :  Optional[Any]				      =			args[0]
               UpperCAmelCase__      :  Tuple				      =			args[1:]

          if audio_values is not None:
               return self._decode_audio(_lowerCAmelCase	,						padding_mask=_lowerCAmelCase		)
          else:
               return self.tokenizer.batch_decode(*_lowerCAmelCase	,						**_lowerCAmelCase		)




     def   __UpperCAmelCase  (				self	,						*_lowerCAmelCase	,						**_lowerCAmelCase		):
          return self.tokenizer.decode(*_lowerCAmelCase	,						**_lowerCAmelCase		)




     def   __UpperCAmelCase  (				self	,						_lowerCAmelCase	,						_lowerCAmelCase = None		):
          UpperCAmelCase__      :  Dict				      =			to_numpy(_lowerCAmelCase		)
          UpperCAmelCase__      ,		UpperCAmelCase__      ,		UpperCAmelCase__      :  Optional[Any]				      =			audio_values.shape

          if padding_mask is None:
               return list(_lowerCAmelCase		)

          UpperCAmelCase__      :  int				      =			to_numpy(_lowerCAmelCase		)

          # match the sequence length of the padding mask to the generated audio arrays by padding with the **non-padding**
          # token (so that the generated audio values are **not** treated as padded tokens)
          UpperCAmelCase__      :  Any				      =			seq_len - padding_mask.shape[-1]
          UpperCAmelCase__      :  Optional[Any]				      =			1 - self.feature_extractor.padding_value
          UpperCAmelCase__      :  List[str]				      =			np.pad(_lowerCAmelCase	,						((0, 0), (0, difference))	,						"""constant"""	,						constant_values=_lowerCAmelCase		)

          UpperCAmelCase__      :  str				      =			audio_values.tolist()
          for i in range(_lowerCAmelCase		):
               UpperCAmelCase__      :  Union[str, Any]				      =			np.asarray(audio_values[i]		)[
                   padding_mask[i][None, :] != self.feature_extractor.padding_value
               ]
               UpperCAmelCase__      :  Optional[Any]				      =			sliced_audio.reshape(_lowerCAmelCase	,						-1		)

          return audio_values










"""simple docstring"""



import math
from datetime import datetime, timedelta
def      UpperCAmelCase     (       _lowercase :   int	)						-> datetime:


	"""simple docstring"""




	lowerCAmelCase_      							=			year % 1_9
	lowerCAmelCase_      							=			year % 4
	lowerCAmelCase_      							=			year % 7
	lowerCAmelCase_      							=			math.floor(year / 1_0_0	)
	lowerCAmelCase_      							=			math.floor((1_3 + 8 * leap_day_inhibits) / 2_5	)
	lowerCAmelCase_      							=			leap_day_inhibits / 4
	lowerCAmelCase_      							=			(
	    1_5 - lunar_orbit_correction + leap_day_inhibits - leap_day_reinstall_number
	) % 3_0
	lowerCAmelCase_      							=			(4 + leap_day_inhibits - leap_day_reinstall_number) % 7

	# days to be added to March 21
	lowerCAmelCase_      							=			(1_9 * metonic_cycle + secular_moon_shift) % 3_0

	# PHM -> Paschal Full Moon
	lowerCAmelCase_      							=			(
	    2 * julian_leap_year
	    + 4 * non_leap_year
	    + 6 * days_to_add
	    + century_starting_point
	) % 7

	if days_to_add == 2_9 and days_from_phm_to_sunday == 6:
		return datetime(_lowercase			,   4			,   1_9	)
	elif days_to_add == 2_8 and days_from_phm_to_sunday == 6:
		return datetime(_lowercase			,   4			,   1_8	)
	else:
		return datetime(_lowercase			,   3			,   2_2	) + timedelta(
		    days=int(days_to_add + days_from_phm_to_sunday	)	)


if __name__ == "__main__":
		for year in (19_94, 20_00, 20_10, 20_21, 20_23):
				lowercase_							=							'will be' if year > datetime.now().year else 'was'
				print(f"""Easter in {year} {tense} {gauss_easter(year)}""")