



import copy
from dataclasses import dataclass, field
from typing import ClassVar, Dict

from ..features import Audio, Features, Value
from .base import TaskTemplate




@dataclass(frozen=snake_case__    )
class   UpperCamelCase_       (     snake_case__    ):
							lowerCamelCase_           =					field(default="automatic-speech-recognition"				,  metadata={"include_in_asdict_even_if_is_default": True}    )
							lowerCamelCase_           =					Features({"audio": Audio()}    )
							lowerCamelCase_           =					Features({"transcription": Value("string"    )}    )
							lowerCamelCase_           =					"audio"
							lowerCamelCase_           =					"transcription"


							def      _snake_case  (							self    :List[Any]							,				__A    :Any		)   ->   int:



									"""simple docstring"""



									if self.audio_column not in features:
											raise ValueError(f'''Column {self.audio_column} is not present in features.'''		)
									if not isinstance(features[self.audio_column]							,				UpperCAmelCase_		):
											raise ValueError(f'''Column {self.audio_column} is not an Audio type.'''		)
									SCREAMING_SNAKE_CASE__			=      copy.deepcopy(self		)
									SCREAMING_SNAKE_CASE__			=      self.input_schema.copy()
									SCREAMING_SNAKE_CASE__			=      features[self.audio_column]
									SCREAMING_SNAKE_CASE__			=      input_schema
									return task_template


							@property
							def      _snake_case  (							self    :List[str]		)   ->   Dict[str, str]:



									"""simple docstring"""



									return {self.audio_column: "audio", self.transcription_column: "transcription"}






from argparse import ArgumentParser

from datasets.commands.convert import ConvertCommand
from datasets.commands.dummy_data import DummyDataCommand
from datasets.commands.env import EnvironmentCommand
from datasets.commands.run_beam import RunBeamCommand
from datasets.commands.test import TestCommand
from datasets.utils.logging import set_verbosity_info






def 				SCREAMING_SNAKE_CASE__							(       UpperCamelCase__:							Any    ):
		return {key.lstrip("""-"""    ): value for key, value in zip(unknown_args[::2]					,   unknown_args[1::2]    )}






def 				SCREAMING_SNAKE_CASE__							(       ):
		SCREAMING_SNAKE_CASE__			=      ArgumentParser(
		    """HuggingFace Datasets CLI tool"""					,   usage="""datasets-cli <command> [<args>]"""					,   allow_abbrev=UpperCamelCase__    )
		SCREAMING_SNAKE_CASE__			=      parser.add_subparsers(help="""datasets-cli command helpers"""    )
		set_verbosity_info()

		# Register commands
		ConvertCommand.register_subcommand(UpperCamelCase__    )
		EnvironmentCommand.register_subcommand(UpperCamelCase__    )
		TestCommand.register_subcommand(UpperCamelCase__    )
		RunBeamCommand.register_subcommand(UpperCamelCase__    )
		DummyDataCommand.register_subcommand(UpperCamelCase__    )

		# Parse args
		SCREAMING_SNAKE_CASE__	,						SCREAMING_SNAKE_CASE__			=      parser.parse_known_args()
		if not hasattr(UpperCamelCase__					,   """func"""    ):
				parser.print_help()
				exit(1    )
		SCREAMING_SNAKE_CASE__			=      parse_unknown_args(UpperCamelCase__    )

		# Run
		SCREAMING_SNAKE_CASE__			=      args.func(UpperCamelCase__					,   **UpperCamelCase__    )
		service.run()


if __name__ == "__main__":
	main()