


'''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 						_lowerCamelCase					(    unittest.TestCase				):




 '''simple docstring'''


 @require_torch
 def  snake_case__   (      self						):

    """simple docstring"""







    __A  :		Optional[int]       =			pipeline(
        task='zero-shot-audio-classification'      ,      model='hf-internal-testing/tiny-clap-htsat-unfused'						)
    __A  :		str       =			load_dataset('ashraq/esc50'						)
    __A  :		Union[str, Any]       =			dataset['train']['audio'][-1]['array']
    __A  :		List[str]       =			audio_classifier(__lowercase      ,      candidate_labels=['Sound of a dog', 'Sound of vaccum cleaner']						)
    self.assertEqual(
        nested_simplify(__lowercase						)      ,      [{'score': 0.5_0_1, 'label': 'Sound of a dog'}, {'score': 0.4_9_9, 'label': 'Sound of vaccum cleaner'}]      ,      )


 @unittest.skip('No models are available in TF'						)
 def  snake_case__   (      self						):

    """simple docstring"""







    pass


 @slow
 @require_torch
 def  snake_case__   (      self						):

    """simple docstring"""







    __A  :		Dict       =			pipeline(
        task='zero-shot-audio-classification'      ,      model='laion/clap-htsat-unfused'      ,      )
    # This is an audio of a dog
    __A  :		Optional[Any]       =			load_dataset('ashraq/esc50'						)
    __A  :		List[str]       =			dataset['train']['audio'][-1]['array']
    __A  :		Union[str, Any]       =			audio_classifier(__lowercase      ,      candidate_labels=['Sound of a dog', 'Sound of vaccum cleaner']						)

    self.assertEqual(
        nested_simplify(__lowercase						)      ,      [
            {'score': 0.9_9_9, 'label': 'Sound of a dog'},
            {'score': 0.0_0_1, 'label': 'Sound of vaccum cleaner'},
        ]      ,      )

    __A  :		Any       =			audio_classifier([audio] * 5      ,      candidate_labels=['Sound of a dog', 'Sound of vaccum cleaner']						)
    self.assertEqual(
        nested_simplify(__lowercase						)      ,      [
            [
                {'score': 0.9_9_9, 'label': 'Sound of a dog'},
                {'score': 0.0_0_1, 'label': 'Sound of vaccum cleaner'},
            ],
        ]
        * 5      ,      )
    __A  :		str       =			audio_classifier(
        [audio] * 5      ,      candidate_labels=['Sound of a dog', 'Sound of vaccum cleaner']      ,      batch_size=5						)
    self.assertEqual(
        nested_simplify(__lowercase						)      ,      [
            [
                {'score': 0.9_9_9, 'label': 'Sound of a dog'},
                {'score': 0.0_0_1, 'label': 'Sound of vaccum cleaner'},
            ],
        ]
        * 5      ,      )







 @unittest.skip('No models are available in TF'						)
 def  snake_case__   (      self						):

    """simple docstring"""







    pass










'''simple docstring'''
from __future__ import annotations


def 			_lowercase       (				UpperCamelCase__       :					list,				UpperCamelCase__       :					int,				UpperCamelCase__       :					int,				UpperCamelCase__       :					int			):
 __A  :		Dict       =			[]
 __A     ,__A  :		Dict       =			input_list[low:mid], input_list[mid : high + 1]
 while left and right:
  result.append((left if left[0] <= right[0] else right).pop(0			)			)
 __A  :		Optional[Any]       =			result + left + right
 return input_list


def 			_lowercase       (				UpperCamelCase__       :					list			):
 if len(UpperCamelCase__			) <= 1:
  return input_list
 __A  :		Any       =			list(UpperCamelCase__			)

 # iteration for two-way merging
 __A  :		Dict       =			2
 while p <= len(UpperCamelCase__			):
  # getting low, high and middle value for merge-sort of single list
  for i in range(0,				len(UpperCamelCase__			),				UpperCamelCase__			):
   __A  :		Union[str, Any]       =			i
   __A  :		Tuple       =			i + p - 1
   __A  :		Union[str, Any]       =			(low + high + 1) // 2
   __A  :		Tuple       =			merge(UpperCamelCase__,				UpperCamelCase__,				UpperCamelCase__,				UpperCamelCase__			)
  # final merge of last two parts
  if p * 2 >= len(UpperCamelCase__			):
   __A  :		Optional[int]       =			i
   __A  :		str       =			merge(UpperCamelCase__,				0,				UpperCamelCase__,				len(UpperCamelCase__			) - 1			)
   break
  p *= 2

 return input_list


if __name__ == "__main__":
 UpperCAmelCase_ :     Any								=      input('Enter numbers separated by a comma:\n').strip()
 if user_input == "":
  UpperCAmelCase_ :     Union[str, Any]								=      []
 else:
  UpperCAmelCase_ :     str								=      [int(item.strip()) for item in user_input.split(',')]
 print(iter_merge_sort(unsorted))






