
'''simple docstring'''

import random
import unittest

import numpy as np

from transformers.testing_utils import require_torch, require_vision
from transformers.utils import is_torch_available, is_vision_available

from ...test_image_processing_common import ImageProcessingSavingTestMixin, prepare_image_inputs


if is_torch_available():
   import torch

if is_vision_available():
   import PIL

   from transformers import FlavaImageProcessor
   from transformers.image_utils import PILImageResampling
   from transformers.models.flava.image_processing_flava import (
       FLAVA_CODEBOOK_MEAN,
       FLAVA_CODEBOOK_STD,
       FLAVA_IMAGE_MEAN,
       FLAVA_IMAGE_STD,
   )
else:
   __UpperCAmelCase												=   __UpperCAmelCase												=   __UpperCAmelCase												=   __UpperCAmelCase												=   None


class 		_a     (							unittest.TestCase  ):







   """simple docstring"""




   def __init__(       self    ,__SCREAMING_SNAKE_CASE    ,__SCREAMING_SNAKE_CASE=7    ,__SCREAMING_SNAKE_CASE=3    ,__SCREAMING_SNAKE_CASE=30    ,__SCREAMING_SNAKE_CASE=400    ,__SCREAMING_SNAKE_CASE=True    ,__SCREAMING_SNAKE_CASE=None    ,__SCREAMING_SNAKE_CASE=True    ,__SCREAMING_SNAKE_CASE=None    ,__SCREAMING_SNAKE_CASE=None    ,__SCREAMING_SNAKE_CASE=True    ,__SCREAMING_SNAKE_CASE=1 / 255    ,__SCREAMING_SNAKE_CASE=True    ,__SCREAMING_SNAKE_CASE=FLAVA_IMAGE_MEAN    ,__SCREAMING_SNAKE_CASE=FLAVA_IMAGE_STD    ,__SCREAMING_SNAKE_CASE=14    ,__SCREAMING_SNAKE_CASE=75    ,__SCREAMING_SNAKE_CASE=None    ,__SCREAMING_SNAKE_CASE=16    ,__SCREAMING_SNAKE_CASE=0.3    ,__SCREAMING_SNAKE_CASE=None    ,__SCREAMING_SNAKE_CASE=True    ,__SCREAMING_SNAKE_CASE=None    ,__SCREAMING_SNAKE_CASE=None    ,__SCREAMING_SNAKE_CASE=True    ,__SCREAMING_SNAKE_CASE=None    ,__SCREAMING_SNAKE_CASE=True    ,__SCREAMING_SNAKE_CASE=True    ,__SCREAMING_SNAKE_CASE=FLAVA_CODEBOOK_MEAN    ,__SCREAMING_SNAKE_CASE=FLAVA_CODEBOOK_STD    ,):
    SCREAMING_SNAKE_CASE  :  str								=		size if size is not None else {"height": 224, "width": 224}
    SCREAMING_SNAKE_CASE  :  List[Any]								=		crop_size if crop_size is not None else {"height": 224, "width": 224}
    SCREAMING_SNAKE_CASE  :  Optional[int]								=		codebook_size if codebook_size is not None else {"height": 112, "width": 112}
    SCREAMING_SNAKE_CASE  :  Optional[Any]								=		codebook_crop_size if codebook_crop_size is not None else {"height": 112, "width": 112}

    SCREAMING_SNAKE_CASE  :  List[str]								=		parent
    SCREAMING_SNAKE_CASE  :  Union[str, Any]								=		batch_size
    SCREAMING_SNAKE_CASE  :  Tuple								=		num_channels
    SCREAMING_SNAKE_CASE  :  Union[str, Any]								=		do_resize
    SCREAMING_SNAKE_CASE  :  Tuple								=		do_rescale
    SCREAMING_SNAKE_CASE  :  Any								=		rescale_factor
    SCREAMING_SNAKE_CASE  :  Tuple								=		min_resolution
    SCREAMING_SNAKE_CASE  :  Dict								=		max_resolution
    SCREAMING_SNAKE_CASE  :  List[Any]								=		size
    SCREAMING_SNAKE_CASE  :  Optional[int]								=		resample if resample is not None else PILImageResampling.BICUBIC
    SCREAMING_SNAKE_CASE  :  Tuple								=		do_normalize
    SCREAMING_SNAKE_CASE  :  Optional[int]								=		image_mean
    SCREAMING_SNAKE_CASE  :  List[Any]								=		image_std
    SCREAMING_SNAKE_CASE  :  Optional[Any]								=		do_center_crop
    SCREAMING_SNAKE_CASE  :  Dict								=		crop_size

    SCREAMING_SNAKE_CASE  :  int								=		input_size_patches
    SCREAMING_SNAKE_CASE  :  str								=		total_mask_patches
    SCREAMING_SNAKE_CASE  :  List[Any]								=		mask_group_max_patches
    SCREAMING_SNAKE_CASE  :  int								=		mask_group_min_patches
    SCREAMING_SNAKE_CASE  :  Union[str, Any]								=		mask_group_min_aspect_ratio
    SCREAMING_SNAKE_CASE  :  Union[str, Any]								=		mask_group_max_aspect_ratio

    SCREAMING_SNAKE_CASE  :  Any								=		codebook_do_resize
    SCREAMING_SNAKE_CASE  :  Dict								=		codebook_size
    SCREAMING_SNAKE_CASE  :  Any								=		codebook_resample if codebook_resample is not None else PILImageResampling.LANCZOS
    SCREAMING_SNAKE_CASE  :  List[str]								=		codebook_do_center_crop
    SCREAMING_SNAKE_CASE  :  List[str]								=		codebook_crop_size
    SCREAMING_SNAKE_CASE  :  List[str]								=		codebook_do_map_pixels
    SCREAMING_SNAKE_CASE  :  List[str]								=		codebook_do_normalize
    SCREAMING_SNAKE_CASE  :  str								=		codebook_image_mean
    SCREAMING_SNAKE_CASE  :  Optional[Any]								=		codebook_image_std






   def 					__a			(       self      ):
    return {
        "image_mean": self.image_mean,
        "image_std": self.image_std,
        "do_normalize": self.do_normalize,
        "do_resize": self.do_resize,
        "size": self.size,
        "resample": self.resample,
        "do_rescale": self.do_rescale,
        "rescale_factor": self.rescale_factor,
        "do_center_crop": self.do_center_crop,
        "crop_size": self.crop_size,
        "input_size_patches": self.input_size_patches,
        "total_mask_patches": self.total_mask_patches,
        "mask_group_max_patches": self.mask_group_max_patches,
        "mask_group_min_patches": self.mask_group_min_patches,
        "mask_group_min_aspect_ratio": self.mask_group_min_aspect_ratio,
        "mask_group_max_aspect_ratio": self.mask_group_min_aspect_ratio,
        "codebook_do_resize": self.codebook_do_resize,
        "codebook_size": self.codebook_size,
        "codebook_resample": self.codebook_resample,
        "codebook_do_center_crop": self.codebook_do_center_crop,
        "codebook_crop_size": self.codebook_crop_size,
        "codebook_do_map_pixels": self.codebook_do_map_pixels,
        "codebook_do_normalize": self.codebook_do_normalize,
        "codebook_image_mean": self.codebook_image_mean,
        "codebook_image_std": self.codebook_image_std,
    }






   def 					__a			(       self      ):
    return (self.size["height"], self.size["width"])






   def 					__a			(       self      ):
    return (
        (self.input_size_patches, self.input_size_patches)
        if not isinstance(self.input_size_patches    ,lowercase_      )
        else self.input_size_patches
    )






   def 					__a			(       self      ):
    return (self.codebook_size["height"], self.codebook_size["width"])



@require_torch
@require_vision
class 		_a     (							__A			,    unittest.TestCase  ):







   """simple docstring"""




   A		= FlavaImageProcessor if is_vision_available() else None
   A		= None






   def 					__a			(       self      ):
    SCREAMING_SNAKE_CASE  :  Dict								=		FlavaImageProcessingTester(self      )






   @property
   def 					__a			(       self      ):
    return self.image_processor_tester.prepare_image_processor_dict()






   def 					__a			(       self      ):
    SCREAMING_SNAKE_CASE  :  Union[str, Any]								=		self.image_processing_class(**self.image_processor_dict      )
    self.assertTrue(hasattr(lowercase_    ,'image_mean'      )      )
    self.assertTrue(hasattr(lowercase_    ,'image_std'      )      )
    self.assertTrue(hasattr(lowercase_    ,'do_normalize'      )      )
    self.assertTrue(hasattr(lowercase_    ,'do_resize'      )      )
    self.assertTrue(hasattr(lowercase_    ,'resample'      )      )
    self.assertTrue(hasattr(lowercase_    ,'crop_size'      )      )
    self.assertTrue(hasattr(lowercase_    ,'do_center_crop'      )      )
    self.assertTrue(hasattr(lowercase_    ,'do_rescale'      )      )
    self.assertTrue(hasattr(lowercase_    ,'rescale_factor'      )      )
    self.assertTrue(hasattr(lowercase_    ,'masking_generator'      )      )
    self.assertTrue(hasattr(lowercase_    ,'codebook_do_resize'      )      )
    self.assertTrue(hasattr(lowercase_    ,'codebook_size'      )      )
    self.assertTrue(hasattr(lowercase_    ,'codebook_resample'      )      )
    self.assertTrue(hasattr(lowercase_    ,'codebook_do_center_crop'      )      )
    self.assertTrue(hasattr(lowercase_    ,'codebook_crop_size'      )      )
    self.assertTrue(hasattr(lowercase_    ,'codebook_do_map_pixels'      )      )
    self.assertTrue(hasattr(lowercase_    ,'codebook_do_normalize'      )      )
    self.assertTrue(hasattr(lowercase_    ,'codebook_image_mean'      )      )
    self.assertTrue(hasattr(lowercase_    ,'codebook_image_std'      )      )






   def 					__a			(       self      ):
    SCREAMING_SNAKE_CASE  :  List[str]								=		self.image_processing_class.from_dict(self.image_processor_dict      )
    self.assertEqual(image_processor.size    ,{'height': 224, 'width': 224}      )
    self.assertEqual(image_processor.crop_size    ,{'height': 224, 'width': 224}      )
    self.assertEqual(image_processor.codebook_size    ,{'height': 112, 'width': 112}      )
    self.assertEqual(image_processor.codebook_crop_size    ,{'height': 112, 'width': 112}      )

    SCREAMING_SNAKE_CASE  :  List[str]								=		self.image_processing_class.from_dict(
        self.image_processor_dict    ,size=42    ,crop_size=84    ,codebook_size=33    ,codebook_crop_size=66      )
    self.assertEqual(image_processor.size    ,{'height': 42, 'width': 42}      )
    self.assertEqual(image_processor.crop_size    ,{'height': 84, 'width': 84}      )
    self.assertEqual(image_processor.codebook_size    ,{'height': 33, 'width': 33}      )
    self.assertEqual(image_processor.codebook_crop_size    ,{'height': 66, 'width': 66}      )






   def 					__a			(       self      ):
    pass






   def 					__a			(       self      ):
    # Initialize image_processing
    SCREAMING_SNAKE_CASE  :  List[Any]								=		self.image_processing_class(**self.image_processor_dict      )
    # create random PIL images
    SCREAMING_SNAKE_CASE  :  str								=		prepare_image_inputs(self.image_processor_tester    ,equal_resolution=lowercase_      )
    for image in image_inputs:
     self.assertIsInstance(lowercase_    ,PIL.Image.Image      )

    # Test not batched input
    SCREAMING_SNAKE_CASE  :  Optional[int]								=		image_processing(image_inputs[0]    ,return_tensors='pt'      )

    # Test no bool masked pos
    self.assertFalse('bool_masked_pos' in encoded_images      )

    SCREAMING_SNAKE_CASE  :  Optional[int]								=		self.image_processor_tester.get_expected_image_size()

    self.assertEqual(
        encoded_images.pixel_values.shape    ,(1, self.image_processor_tester.num_channels, expected_height, expected_width)    ,)

    # Test batched
    SCREAMING_SNAKE_CASE  :  Optional[Any]								=		image_processing(lowercase_    ,return_tensors='pt'      )
    SCREAMING_SNAKE_CASE  :  List[Any]								=		self.image_processor_tester.get_expected_image_size()

    # Test no bool masked pos
    self.assertFalse('bool_masked_pos' in encoded_images      )

    self.assertEqual(
        encoded_images.pixel_values.shape    ,(
            self.image_processor_tester.batch_size,
            self.image_processor_tester.num_channels,
            expected_height,
            expected_width,
        )    ,)






   def 					__a			(       self    ,__SCREAMING_SNAKE_CASE    ,__SCREAMING_SNAKE_CASE      ):
    # Initialize image_processing
    SCREAMING_SNAKE_CASE  :  Any								=		self.image_processing_class(**self.image_processor_dict      )
    # create random tensors
    SCREAMING_SNAKE_CASE  :  Dict								=		prepare_image_inputs(self.image_processor_tester    ,equal_resolution=lowercase_    ,**lowercase_      )
    for image in image_inputs:
     self.assertIsInstance(lowercase_    ,lowercase_      )

    # Test not batched input
    SCREAMING_SNAKE_CASE  :  str								=		image_processing(image_inputs[0]    ,return_tensors='pt'      )

    SCREAMING_SNAKE_CASE  :  Optional[Any]								=		self.image_processor_tester.get_expected_image_size()
    self.assertEqual(
        encoded_images.pixel_values.shape    ,(1, self.image_processor_tester.num_channels, expected_height, expected_width)    ,)

    SCREAMING_SNAKE_CASE  :  List[Any]								=		image_processing(lowercase_    ,return_image_mask=lowercase_    ,return_tensors='pt'      )

    SCREAMING_SNAKE_CASE  :  Optional[int]								=		self.image_processor_tester.get_expected_image_size()
    self.assertEqual(
        encoded_images.pixel_values.shape    ,(
            self.image_processor_tester.batch_size,
            self.image_processor_tester.num_channels,
            expected_height,
            expected_width,
        )    ,)

    SCREAMING_SNAKE_CASE  :  int								=		self.image_processor_tester.get_expected_mask_size()
    self.assertEqual(
        encoded_images.bool_masked_pos.shape    ,(
            self.image_processor_tester.batch_size,
            expected_height,
            expected_width,
        )    ,)

    # Test batched
    SCREAMING_SNAKE_CASE  :  Any								=		image_processing(lowercase_    ,return_tensors='pt'      ).pixel_values

    SCREAMING_SNAKE_CASE  :  Optional[int]								=		self.image_processor_tester.get_expected_image_size()
    self.assertEqual(
        encoded_images.shape    ,(
            self.image_processor_tester.batch_size,
            self.image_processor_tester.num_channels,
            expected_height,
            expected_width,
        )    ,)

    # Test masking
    SCREAMING_SNAKE_CASE  :  int								=		image_processing(lowercase_    ,return_image_mask=lowercase_    ,return_tensors='pt'      )

    SCREAMING_SNAKE_CASE  :  List[Any]								=		self.image_processor_tester.get_expected_image_size()
    self.assertEqual(
        encoded_images.pixel_values.shape    ,(
            self.image_processor_tester.batch_size,
            self.image_processor_tester.num_channels,
            expected_height,
            expected_width,
        )    ,)

    SCREAMING_SNAKE_CASE  :  Union[str, Any]								=		self.image_processor_tester.get_expected_mask_size()
    self.assertEqual(
        encoded_images.bool_masked_pos.shape    ,(
            self.image_processor_tester.batch_size,
            expected_height,
            expected_width,
        )    ,)






   def 					__a			(       self      ):
    self._test_call_framework(np.ndarray    ,prepare_kwargs={'numpify': True}      )






   def 					__a			(       self      ):
    self._test_call_framework(torch.Tensor    ,prepare_kwargs={'torchify': True}      )






   def 					__a			(       self      ):
    # Initialize image_processing
    random.seed(1234      )
    SCREAMING_SNAKE_CASE  :  List[Any]								=		self.image_processing_class(**self.image_processor_dict      )
    SCREAMING_SNAKE_CASE  :  Optional[int]								=		prepare_image_inputs(self.image_processor_tester    ,equal_resolution=lowercase_    ,torchify=lowercase_      )

    # Test not batched input
    SCREAMING_SNAKE_CASE  :  List[str]								=		image_processing(image_inputs[0]    ,return_image_mask=lowercase_    ,return_tensors='pt'      )
    self.assertEqual(encoded_images.bool_masked_pos.sum().item()    ,75      )






   def 					__a			(       self      ):
    # Initialize image_processing
    SCREAMING_SNAKE_CASE  :  int								=		self.image_processing_class(**self.image_processor_dict      )
    # create random PIL images
    SCREAMING_SNAKE_CASE  :  Tuple								=		prepare_image_inputs(self.image_processor_tester    ,equal_resolution=lowercase_      )
    for image in image_inputs:
     self.assertIsInstance(lowercase_    ,PIL.Image.Image      )

    # Test not batched input
    SCREAMING_SNAKE_CASE  :  int								=		image_processing(image_inputs[0]    ,return_codebook_pixels=lowercase_    ,return_tensors='pt'      )
    SCREAMING_SNAKE_CASE  :  List[str]								=		self.image_processor_tester.get_expected_codebook_image_size()
    self.assertEqual(
        encoded_images.codebook_pixel_values.shape    ,(1, self.image_processor_tester.num_channels, expected_height, expected_width)    ,)

    # Test batched
    SCREAMING_SNAKE_CASE  :  Any								=		image_processing(lowercase_    ,return_codebook_pixels=lowercase_    ,return_tensors='pt'      )
    SCREAMING_SNAKE_CASE  :  Tuple								=		self.image_processor_tester.get_expected_codebook_image_size()
    self.assertEqual(
        encoded_images.codebook_pixel_values.shape    ,(
            self.image_processor_tester.batch_size,
            self.image_processor_tester.num_channels,
            expected_height,
            expected_width,
        )    ,)



import random
import shutil
import tempfile
import unittest

import numpy as np

from transformers import TaTokenizer, TaTokenizerFast
from transformers.testing_utils import require_sentencepiece, require_torch
from transformers.utils.import_utils import is_speech_available, is_torch_available


if is_torch_available():
      pass

if is_speech_available():
      from transformers import EncodecFeatureExtractor, MusicgenProcessor


UpperCamelCase    				=		random.Random()

def      lowercase_							(     _lowerCamelCase				:			Union[str, Any]						,      _lowerCamelCase				:			str=1.0						,      _lowerCamelCase				:			Optional[int]=None						,      _lowerCamelCase				:			int=None):
    if rng is None:
        lowercase__					:  Dict          =							global_rng

    lowercase__					:  Optional[Any]          =							[]
    for batch_idx in range(shape[0]):
        values.append([])
        for _ in range(shape[1]):
            values[-1].append(rng.random() * scale)

    return values



@require_torch
@require_sentencepiece
class     snake_case_			(						unittest.TestCase			):






   def  __UpperCamelCase	( self							:	Union[str, Any]    )   ->		Union[str, Any]:
       lowercase__					:  List[Any]          =							"facebook/musicgen-small"
       lowercase__					:  List[Any]          =							tempfile.mkdtemp()






   def  __UpperCamelCase	( self							:	Optional[Any]      ,		**lowercase_							:	Optional[Any]    )   ->		Optional[Any]:
       return TaTokenizer.from_pretrained(self.checkpoint      ,		**lowercase_    )






   def  __UpperCamelCase	( self							:	int      ,		**lowercase_							:	Any    )   ->		List[Any]:
       return EncodecFeatureExtractor.from_pretrained(self.checkpoint      ,		**lowercase_    )






   def  __UpperCamelCase	( self							:	str    )   ->		List[Any]:
       shutil.rmtree(self.tmpdirname    )






   def  __UpperCamelCase	( self							:	Dict    )   ->		Union[str, Any]:
       lowercase__					:  List[str]          =							self.get_tokenizer()
       lowercase__					:  Optional[Any]          =							self.get_feature_extractor()

       lowercase__					:  Any          =							MusicgenProcessor(tokenizer=lowercase_      ,		feature_extractor=lowercase_    )

       processor.save_pretrained(self.tmpdirname    )
       lowercase__					:  Union[str, Any]          =							MusicgenProcessor.from_pretrained(self.tmpdirname    )

       self.assertEqual(processor.tokenizer.get_vocab()      ,		tokenizer.get_vocab()    )
       self.assertIsInstance(processor.tokenizer      ,		lowercase_    )

       self.assertEqual(processor.feature_extractor.to_json_string()      ,		feature_extractor.to_json_string()    )
       self.assertIsInstance(processor.feature_extractor      ,		lowercase_    )






   def  __UpperCamelCase	( self							:	List[str]    )   ->		Union[str, Any]:
       lowercase__					:  Tuple          =							MusicgenProcessor(tokenizer=self.get_tokenizer()      ,		feature_extractor=self.get_feature_extractor()    )
       processor.save_pretrained(self.tmpdirname    )

       lowercase__					:  int          =							self.get_tokenizer(bos_token="(BOS)"      ,		eos_token="(EOS)"    )
       lowercase__					:  int          =							self.get_feature_extractor(do_normalize=lowercase_      ,		padding_value=1.0    )

       lowercase__					:  Optional[int]          =							MusicgenProcessor.from_pretrained(
           self.tmpdirname      ,		bos_token="(BOS)"      ,		eos_token="(EOS)"      ,		do_normalize=lowercase_      ,		padding_value=1.0    )

       self.assertEqual(processor.tokenizer.get_vocab()      ,		tokenizer_add_kwargs.get_vocab()    )
       self.assertIsInstance(processor.tokenizer      ,		lowercase_    )

       self.assertEqual(processor.feature_extractor.to_json_string()      ,		feature_extractor_add_kwargs.to_json_string()    )
       self.assertIsInstance(processor.feature_extractor      ,		lowercase_    )






   def  __UpperCamelCase	( self							:	List[Any]    )   ->		Optional[Any]:
       lowercase__					:  str          =							self.get_feature_extractor()
       lowercase__					:  Union[str, Any]          =							self.get_tokenizer()

       lowercase__					:  str          =							MusicgenProcessor(tokenizer=lowercase_      ,		feature_extractor=lowercase_    )

       lowercase__					:  Tuple          =							floats_list((3, 10_00)    )

       lowercase__					:  int          =							feature_extractor(lowercase_      ,		return_tensors="np"    )
       lowercase__					:  int          =							processor(lowercase_      ,		return_tensors="np"    )

       for key in input_feat_extract.keys():
           self.assertAlmostEqual(input_feat_extract[key].sum()      ,		input_processor[key].sum()      ,		delta=1E-2    )






   def  __UpperCamelCase	( self							:	Any    )   ->		int:
       lowercase__					:  List[Any]          =							self.get_feature_extractor()
       lowercase__					:  int          =							self.get_tokenizer()

       lowercase__					:  int          =							MusicgenProcessor(tokenizer=lowercase_      ,		feature_extractor=lowercase_    )

       lowercase__					:  Tuple          =							"This is a test string"

       lowercase__					:  Any          =							processor(text=lowercase_    )

       lowercase__					:  str          =							tokenizer(lowercase_    )

       for key in encoded_tok.keys():
           self.assertListEqual(encoded_tok[key]      ,		encoded_processor[key]    )






   def  __UpperCamelCase	( self							:	Tuple    )   ->		List[str]:
       lowercase__					:  Dict          =							self.get_feature_extractor()
       lowercase__					:  Optional[Any]          =							self.get_tokenizer()

       lowercase__					:  str          =							MusicgenProcessor(tokenizer=lowercase_      ,		feature_extractor=lowercase_    )

       lowercase__					:  Any          =							[[1, 4, 5, 8, 1, 0, 8], [3, 4, 3, 1, 1, 8, 9]]

       lowercase__					:  List[Any]          =							processor.batch_decode(sequences=lowercase_    )
       lowercase__					:  Optional[Any]          =							tokenizer.batch_decode(lowercase_    )

       self.assertListEqual(lowercase_      ,		lowercase_    )






   def  __UpperCamelCase	( self							:	Dict    )   ->		List[str]:
       lowercase__					:  List[Any]          =							self.get_feature_extractor()
       lowercase__					:  Union[str, Any]          =							self.get_tokenizer()

       lowercase__					:  str          =							MusicgenProcessor(tokenizer=lowercase_      ,		feature_extractor=lowercase_    )

       self.assertListEqual(
           processor.model_input_names      ,		feature_extractor.model_input_names      ,		msg="`processor` and `feature_extractor` model input names do not match"      ,		)







   def  __UpperCamelCase	( self							:	Optional[Any]    )   ->		Optional[int]:
       lowercase__					:  List[str]          =							self.get_feature_extractor(padding_side="left"    )
       lowercase__					:  Tuple          =							self.get_tokenizer()

       lowercase__					:  Any          =							MusicgenProcessor(tokenizer=lowercase_      ,		feature_extractor=lowercase_    )

       lowercase__					:  Optional[Any]          =							[floats_list((1, x)    )[0] for x in range(5      ,		20      ,		5    )]
       lowercase__					:  Optional[int]          =							processor(lowercase_    ).padding_mask

       lowercase__					:  Union[str, Any]          =							np.asarray(floats_list((3, 20)    )    )[:, None, :]
       lowercase__					:  Dict          =							processor.batch_decode(lowercase_      ,		padding_mask=lowercase_    )

       self.assertIsInstance(lowercase_      ,		lowercase_    )

       for audio in decoded_audios:
           self.assertIsInstance(lowercase_      ,		np.ndarray    )

       self.assertTrue(decoded_audios[0].shape == (1, 10)    )
       self.assertTrue(decoded_audios[1].shape == (1, 15)    )
       self.assertTrue(decoded_audios[2].shape == (1, 20)    )



