
'''simple docstring'''



import warnings
from contextlib import contextmanager

from ...processing_utils import ProcessorMixin
from .feature_extraction_wavaveca import WavaVecaFeatureExtractor
from .tokenization_wavaveca import WavaVecaCTCTokenizer




class     UpperCAmelCase_	(						_SCREAMING_SNAKE_CASE					):






						'''simple docstring'''






						_lowercase						: List[Any]										=  '''Wav2Vec2FeatureExtractor'''
						_lowercase						: Optional[Any]										=  '''AutoTokenizer'''




						def __init__(   self       ,  _lowercase       ,  _lowercase ):

												"""simple docstring"""



												super().__init__(_lowercase       ,  _lowercase )
												_lowerCAmelCase    		=					self.feature_extractor
												_lowerCAmelCase    		=					False




						@classmethod
						def    _lowercase      (   cls       ,  _lowercase       ,  **_lowercase ):

												"""simple docstring"""



												try:
																		return super().from_pretrained(_lowercase       ,  **_lowercase )
												except OSError:
																		warnings.warn(
																		    F'Loading a tokenizer inside {cls.__name__} from a config that does not'
																		    """ include a `tokenizer_class` attribute is deprecated and will be """
																		    """removed in v5. Please add `'tokenizer_class': 'Wav2Vec2CTCTokenizer'`"""
																		    """ attribute to either your `config.json` or `tokenizer_config.json` """
																		    """file to suppress this warning: """       ,  _lowercase       ,  )

																		_lowerCAmelCase    		=					WavaVecaFeatureExtractor.from_pretrained(_lowercase       ,  **_lowercase )
																		_lowerCAmelCase    		=					WavaVecaCTCTokenizer.from_pretrained(_lowercase       ,  **_lowercase )

																		return cls(feature_extractor=_lowercase       ,  tokenizer=_lowercase )




						def __call__(   self       ,  *_lowercase       ,  **_lowercase ):

												"""simple docstring"""



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

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

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




						def    _lowercase      (   self       ,  *_lowercase       ,  **_lowercase ):

												"""simple docstring"""



												if self._in_target_context_manager:
																		return self.current_processor.pad(*_lowercase       ,  **_lowercase )

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

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

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




						def    _lowercase      (   self       ,  *_lowercase       ,  **_lowercase ):

												"""simple docstring"""



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




						def    _lowercase      (   self       ,  *_lowercase       ,  **_lowercase ):

												"""simple docstring"""



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




						@contextmanager
						def    _lowercase      (   self ):

												"""simple docstring"""



												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.""" )
												_lowerCAmelCase    		=					True
												_lowerCAmelCase    		=					self.tokenizer
												yield
												_lowerCAmelCase    		=					self.feature_extractor
												_lowerCAmelCase    		=					False







"""simple docstring"""


def        lowercase__     (       lowercase_      )       ->		list:




      """simple docstring"""

      if len(lowercase_      ) <= 1:
            return [tuple(lowercase_      )]

      _UpperCamelCase   :						Optional[Any]    =							[]

      def generate(lowercase_		,lowercase_      ):
            if k == 1:
                  res.append(tuple(arr[:]      )      )
                  return

            generate(k - 1		,lowercase_      )

            for i in range(k - 1      ):
                  if k % 2 == 0:  # k is even
                        _UpperCamelCase,	_UpperCamelCase   :						List[str]    =							arr[k - 1], arr[i]
                  else:  # k is odd
                        _UpperCamelCase,	_UpperCamelCase   :						int    =							arr[k - 1], arr[0]
                  generate(k - 1		,lowercase_      )

      generate(len(lowercase_      )		,lowercase_      )
      return res


if __name__ == "__main__":
  lowerCamelCase__						= input("Enter numbers separated by a comma:\n").strip()
  lowerCamelCase__						= [int(item) for item in user_input.split(",")]
  print(heaps(arr))
