






"""simple docstring"""





def 	lowerCamelCase__			(				_lowerCamelCase			:						Dict						,							_lowerCamelCase			:						Tuple						,							_lowerCamelCase			:						Union[str, Any]						,							_lowerCamelCase			:						List[Any]						,							_lowerCamelCase			:						Optional[int]						,							_lowerCamelCase			:						Any					) ->							int:
  if index == r:
    for j in range(_lowerCamelCase					):
      print(data[j]						,							end=' '					)
    print(' '					)
    return
  #  When no more elements are there to put in data[]
  if i >= n:
    return
  # current is included, put next at next location
  lowerCamelCase_       	=		arr[i]
  combination_util(_lowerCamelCase						,							_lowerCamelCase						,							_lowerCamelCase						,							index + 1						,							_lowerCamelCase						,							i + 1					)
  # current is excluded, replace it with
  # next (Note that i+1 is passed, but
  # index is not changed)
  combination_util(_lowerCamelCase						,							_lowerCamelCase						,							_lowerCamelCase						,							_lowerCamelCase						,							_lowerCamelCase						,							i + 1					)
  # The main function that prints all combinations
  # of size r in arr[] of size n. This function
  # mainly uses combinationUtil()







def 	lowerCamelCase__			(				_lowerCamelCase			:						Dict						,							_lowerCamelCase			:						List[Any]						,							_lowerCamelCase			:						str					) ->							int:
  # A temporary array to store all combination one by one
  lowerCamelCase_       	=		[0] * r
  # Print all combination using temporary array 'data[]'
  combination_util(_lowerCamelCase						,							_lowerCamelCase						,							_lowerCamelCase						,							0						,							_lowerCamelCase						,							0					)


if __name__ == "__main__":
  # Driver code to check the function above
  _SCREAMING_SNAKE_CASE   :							Optional[int]          =		[10, 20, 30, 40, 50]
  print_combination(arr, len(arr), 3)
  # This code is contributed by Ambuj sahu












"""simple docstring"""





import unittest

from datasets import load_dataset

from transformers.pipelines import pipeline
from transformers.testing_utils import is_pipeline_test, nested_simplify, require_torch, slow






@is_pipeline_test
@require_torch
class 	a		(   unittest.TestCase						):






    @require_torch
    def   UpperCamelCase			(			self	:				str   )	->						str:
      lowerCamelCase_       	=		pipeline(
          task='zero-shot-audio-classification'			,		model='hf-internal-testing/tiny-clap-htsat-unfused'   )
      lowerCamelCase_       	=		load_dataset('ashraq/esc50'   )
      lowerCamelCase_       	=		dataset['train']['audio'][-1]['array']
      lowerCamelCase_       	=		audio_classifier(__SCREAMING_SNAKE_CASE			,		candidate_labels=['Sound of a dog', 'Sound of vaccum cleaner']   )
      self.assertEqual(
          nested_simplify(__SCREAMING_SNAKE_CASE   )			,		[{'score': 0.501, 'label': 'Sound of a dog'}, {'score': 0.499, 'label': 'Sound of vaccum cleaner'}]			,		)






    @unittest.skip('No models are available in TF'   )
    def   UpperCamelCase			(			self	:				Tuple   )	->						Optional[Any]:
      pass






    @slow
    @require_torch
    def   UpperCamelCase			(			self	:				Optional[Any]   )	->						Optional[Any]:
      lowerCamelCase_       	=		pipeline(
          task='zero-shot-audio-classification'			,		model='laion/clap-htsat-unfused'			,		)
      # This is an audio of a dog
      lowerCamelCase_       	=		load_dataset('ashraq/esc50'   )
      lowerCamelCase_       	=		dataset['train']['audio'][-1]['array']
      lowerCamelCase_       	=		audio_classifier(__SCREAMING_SNAKE_CASE			,		candidate_labels=['Sound of a dog', 'Sound of vaccum cleaner']   )

      self.assertEqual(
          nested_simplify(__SCREAMING_SNAKE_CASE   )			,		[
              {'score': 0.999, 'label': 'Sound of a dog'},
              {'score': 0.001, 'label': 'Sound of vaccum cleaner'},
          ]			,		)

      lowerCamelCase_       	=		audio_classifier([audio] * 5			,		candidate_labels=['Sound of a dog', 'Sound of vaccum cleaner']   )
      self.assertEqual(
          nested_simplify(__SCREAMING_SNAKE_CASE   )			,		[
              [
                  {'score': 0.999, 'label': 'Sound of a dog'},
                  {'score': 0.001, 'label': 'Sound of vaccum cleaner'},
              ],
          ]
          * 5			,		)
      lowerCamelCase_       	=		audio_classifier(
          [audio] * 5			,		candidate_labels=['Sound of a dog', 'Sound of vaccum cleaner']			,		batch_size=5   )
      self.assertEqual(
          nested_simplify(__SCREAMING_SNAKE_CASE   )			,		[
              [
                  {'score': 0.999, 'label': 'Sound of a dog'},
                  {'score': 0.001, 'label': 'Sound of vaccum cleaner'},
              ],
          ]
          * 5			,		)






    @unittest.skip('No models are available in TF'   )
    def   UpperCamelCase			(			self	:				Optional[int]   )	->						int:
      pass




