

'''simple docstring'''





from typing import List

import datasets
from datasets.tasks import AudioClassification

from ..folder_based_builder import folder_based_builder


a_						     =    datasets.utils.logging.get_logger(__name__)






class _UpperCamelCase							(							folder_based_builder.FolderBasedBuilderConfig   ):
			'''simple docstring'''







			lowerCamelCase__           =None
			lowerCamelCase__           =None






class _UpperCamelCase							(							folder_based_builder.FolderBasedBuilder   ):
			'''simple docstring'''







			lowerCamelCase__           =datasets.Audio()
			lowerCamelCase__           ='''audio'''
			lowerCamelCase__           =AudioFolderConfig
			lowerCamelCase__           =42  # definition at the bottom of the script
			lowerCamelCase__           =AudioClassification(audio_column='audio'							,	label_column='label'   )

a_						     =    [
    '''.aiff''',
    '''.au''',
    '''.avr''',
    '''.caf''',
    '''.flac''',
    '''.htk''',
    '''.svx''',
    '''.mat4''',
    '''.mat5''',
    '''.mpc2k''',
    '''.ogg''',
    '''.paf''',
    '''.pvf''',
    '''.raw''',
    '''.rf64''',
    '''.sd2''',
    '''.sds''',
    '''.ircam''',
    '''.voc''',
    '''.w64''',
    '''.wav''',
    '''.nist''',
    '''.wavex''',
    '''.wve''',
    '''.xi''',
    '''.mp3''',
    '''.opus''',
]
a_						     =    AUDIO_EXTENSIONS


import os
import tempfile
import unittest

from transformers.models.marian.convert_marian_tatoeba_to_pytorch import DEFAULT_REPO, TatoebaConverter
from transformers.testing_utils import slow
from transformers.utils import cached_property






@unittest.skipUnless(os.path.exists(__A   )							,	'Tatoeba directory does not exist.'   )
class _UpperCamelCase							(							unittest.TestCase   ):
			'''simple docstring'''







			@cached_property
			def 							__UpperCamelCase (			self							: Any	)							->       str:

				"""simple docstring"""

				SCREAMING_SNAKE_CASE   :      Optional[Any]				     =       tempfile.mkdtemp()
				return TatoebaConverter(save_dir=a	)
			@slow
			def 							__UpperCamelCase (			self							: List[Any]	)							->       int:

				"""simple docstring"""

				self.resolver.convert_models(["heb-eng"]	)






			@slow
			def 							__UpperCamelCase (			self							: Optional[int]	)							->       Dict:

				"""simple docstring"""

				SCREAMING_SNAKE_CASE     ,SCREAMING_SNAKE_CASE   :      Optional[Any]				     =       self.resolver.write_model_card("opus-mt-he-en"      ,      dry_run=a	)
				assert mmeta["long_pair"] == "heb-eng"