




def 			__magic_name__				( A		:					str,  A		:					int   ):






			'''simple docstring'''







			a    =			[[] for _ in range(A   )]
			a    =			key - 1

			if key <= 0:
						raise ValueError("Height of grid can't be 0 or negative"   )
			if key == 1 or len(A   ) <= key:
						return input_string

			for position, character in enumerate(A   ):
						a    =			position % (lowest * 2)  # puts it in bounds
						a    =			min(A,  lowest * 2 - num   )  # creates zigzag pattern
						temp_grid[num].append(A   )
			a    =			["".join(A   ) for row in temp_grid]
			a    =			"".join(A   )

			return output_string




def 			__magic_name__				( A		:					str,  A		:					int   ):






			'''simple docstring'''







			a    =			[]
			a    =			key - 1

			if key <= 0:
						raise ValueError("Height of grid can't be 0 or negative"   )
			if key == 1:
						return input_string

			a    =			[[] for _ in range(A   )]  # generates template
			for position in range(len(A   )   ):
						a    =			position % (lowest * 2)  # puts it in bounds
						a    =			min(A,  lowest * 2 - num   )  # creates zigzag pattern
						temp_grid[num].append("*"   )

			a    =			0
			for row in temp_grid:  # fills in the characters
						a    =			input_string[counter : counter + len(A   )]
						grid.append(list(A   )   )
						counter += len(A   )

			a    =			""  # reads as zigzag
			for position in range(len(A   )   ):
						a    =			position % (lowest * 2)  # puts it in bounds
						a    =			min(A,  lowest * 2 - num   )  # creates zigzag pattern
						output_string += grid[num][0]
						grid[num].pop(0   )
			return output_string




def 			__magic_name__				( A		:					str   ):






			'''simple docstring'''







			a    =			{}
			for key_guess in range(1,  len(A   )   ):  # tries every key
						a    =			decrypt(A,  A   )
			return results


if __name__ == "__main__":
		import doctest

		doctest.testmod()







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






   @require_torch
   def       __UpperCamelCase     (      self				:     Optional[int]  )					->						List[Any]:
       lowercase__ :   Union[str, Any]    					=				pipeline(
           task="zero-shot-audio-classification"	,						model="hf-internal-testing/tiny-clap-htsat-unfused"  )
       lowercase__ :   List[str]    					=				load_dataset("ashraq/esc50"  )
       lowercase__ :   List[Any]    					=				dataset["train"]["audio"][-1]["array"]
       lowercase__ :   Dict    					=				audio_classifier(lowercase_	,						candidate_labels=["Sound of a dog", "Sound of vaccum cleaner"]  )
       self.assertEqual(
           nested_simplify(lowercase_  )	,						[{"score": 0.5_01, "label": "Sound of a dog"}, {"score": 0.4_99, "label": "Sound of vaccum cleaner"}]	,						)






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






   @slow
   @require_torch
   def       __UpperCamelCase     (      self				:     List[str]  )					->						int:
       lowercase__ :   Tuple    					=				pipeline(
           task="zero-shot-audio-classification"	,						model="laion/clap-htsat-unfused"	,						)
       # This is an audio of a dog
       lowercase__ :   Union[str, Any]    					=				load_dataset("ashraq/esc50"  )
       lowercase__ :   Tuple    					=				dataset["train"]["audio"][-1]["array"]
       lowercase__ :   List[Any]    					=				audio_classifier(lowercase_	,						candidate_labels=["Sound of a dog", "Sound of vaccum cleaner"]  )

       self.assertEqual(
           nested_simplify(lowercase_  )	,						[
               {"score": 0.9_99, "label": "Sound of a dog"},
               {"score": 0.0_01, "label": "Sound of vaccum cleaner"},
           ]	,						)

       lowercase__ :   int    					=				audio_classifier([audio] * 5	,						candidate_labels=["Sound of a dog", "Sound of vaccum cleaner"]  )
       self.assertEqual(
           nested_simplify(lowercase_  )	,						[
               [
                   {"score": 0.9_99, "label": "Sound of a dog"},
                   {"score": 0.0_01, "label": "Sound of vaccum cleaner"},
               ],
           ]
           * 5	,						)
       lowercase__ :   Tuple    					=				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_99, "label": "Sound of a dog"},
                   {"score": 0.0_01, "label": "Sound of vaccum cleaner"},
               ],
           ]
           * 5	,						)







   @unittest.skip("No models are available in TF"  )
   def       __UpperCamelCase     (      self				:     Union[str, Any]  )					->						Dict:
       pass



