






"""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   ):
   @require_torch
   def       __a							(		self      :	Any							):


        '''simple docstring'''
        UpperCAmelCase__						:    int							=							pipeline(
            task="zero-shot-audio-classification"							,			model="hf-internal-testing/tiny-clap-htsat-unfused"							)
        UpperCAmelCase__						:    int							=							load_dataset("ashraq/esc50"							)
        UpperCAmelCase__						:    Dict							=							dataset["train"]["audio"][-1]["array"]
        UpperCAmelCase__						:    Optional[int]							=							audio_classifier(snake_case__							,			candidate_labels=["Sound of a dog", "Sound of vaccum cleaner"]							)
        self.assertEqual(
            nested_simplify(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       __a							(		self      :	List[Any]							):


        '''simple docstring'''
        pass
   @slow
   @require_torch
   def       __a							(		self      :	Union[str, Any]							):


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

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

        UpperCAmelCase__						:    Any							=							audio_classifier([audio] * 5							,			candidate_labels=["Sound of a dog", "Sound of vaccum cleaner"]							)
        self.assertEqual(
            nested_simplify(snake_case__							)							,			[
                [
                    {"score": 0.999, "label": "Sound of a dog"},
                    {"score": 0.001, "label": "Sound of vaccum cleaner"},
                ],
            ]
            * 5							,			)
        UpperCAmelCase__						:    Tuple							=							audio_classifier(
            [audio] * 5							,			candidate_labels=["Sound of a dog", "Sound of vaccum cleaner"]							,			batch_size=5							)
        self.assertEqual(
            nested_simplify(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       __a							(		self      :	Union[str, Any]							):


        '''simple docstring'''
        pass










"""simple docstring"""



import os


def 	SCREAMING_SNAKE_CASE__       (  )->		Optional[Any]:






     '''simple docstring'''



     with open(os.path.dirname(snake_case				) + "/p022_names.txt"				) as file:
          UpperCAmelCase__						:    Tuple							=							str(file.readlines()[0]				)
          UpperCAmelCase__						:    str							=							names.replace("\""			,					""				).split(","				)

     names.sort()

     UpperCAmelCase__						:    Optional[int]							=							0
     UpperCAmelCase__						:    List[str]							=							0

     for i, name in enumerate(snake_case				):
          for letter in name:
               name_score += ord(snake_case				) - 64

          total_score += (i + 1) * name_score
          UpperCAmelCase__						:    Optional[int]							=							0
     return total_score


if __name__ == "__main__":
 print(solution())


