
"""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       UpperCamelCase   (				unittest.TestCase	):
     @require_torch
     def 					__SCREAMING_SNAKE_CASE				(  self					):




       """simple docstring"""


       _SCREAMING_SNAKE_CASE :					Any				     =			pipeline(
           task="zero-shot-audio-classification"	,  model="hf-internal-testing/tiny-clap-htsat-unfused"					)
       _SCREAMING_SNAKE_CASE :					Tuple				     =			load_dataset("ashraq/esc50"					)
       _SCREAMING_SNAKE_CASE :					List[str]				     =			dataset["train"]["audio"][-1]["array"]
       _SCREAMING_SNAKE_CASE :					List[str]				     =			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 					__SCREAMING_SNAKE_CASE				(  self					):




       """simple docstring"""


       pass
     @slow
     @require_torch
     def 					__SCREAMING_SNAKE_CASE				(  self					):




       """simple docstring"""


       _SCREAMING_SNAKE_CASE :					str				     =			pipeline(
           task="zero-shot-audio-classification"	,  model="laion/clap-htsat-unfused"	,  )
       # This is an audio of a dog
       _SCREAMING_SNAKE_CASE :					List[str]				     =			load_dataset("ashraq/esc50"					)
       _SCREAMING_SNAKE_CASE :					Optional[int]				     =			dataset["train"]["audio"][-1]["array"]
       _SCREAMING_SNAKE_CASE :					Any				     =			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"},
           ]	,  )

       _SCREAMING_SNAKE_CASE :					Tuple				     =			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	,  )
       _SCREAMING_SNAKE_CASE :					Any				     =			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 					__SCREAMING_SNAKE_CASE				(  self					):




       """simple docstring"""


       pass





"""simple docstring"""




from itertools import product



def     __magic_name__		(					UpperCamelCase     :		int							,		UpperCamelCase     :		int     )     ->						list[int]:
    a__		=			sides_number
    a__		=			max_face_number * dice_number
    a__		=			[0] * (max_total + 1)

    a__		=			1
    a__		=			range(UpperCamelCase							,		max_face_number + 1     )
    for dice_numbers in product(UpperCamelCase							,		repeat=UpperCamelCase     ):
        a__		=			sum(UpperCamelCase     )
        totals_frequencies[total] += 1

    return totals_frequencies



def     __magic_name__		(					)     ->						float:
    a__		=			total_frequency_distribution(
        sides_number=4							,		dice_number=9     )
    a__		=			total_frequency_distribution(
        sides_number=6							,		dice_number=6     )

    a__		=			0
    a__		=			9
    a__		=			4 * 9
    a__		=			6
    for peter_total in range(UpperCamelCase							,		max_peter_total + 1     ):
        peter_wins_count += peter_totals_frequencies[peter_total] * sum(
            colin_totals_frequencies[min_colin_total:peter_total]     )

    a__		=			(4**9) * (6**6)
    a__		=			peter_wins_count / total_games_number

    a__		=			round(UpperCamelCase							,		ndigits=7     )

    return rounded_peter_win_probability


if __name__ == "__main__":
    print(F'''{solution() = }''')


