


"""simple docstring"""





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

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



@dataclass(frozen=a__			)
class 		snake_case_(       a__			):
     __UpperCamelCase  =					field(default='''automatic-speech-recognition'''							,					metadata={'''include_in_asdict_even_if_is_default''': True}			)
     __UpperCamelCase  =					Features({'''audio''': Audio()}			)
     __UpperCamelCase  =					Features({'''transcription''': Value('''string'''			)}			)
     __UpperCamelCase  =					'''audio'''
     __UpperCamelCase  =					'''transcription'''






     def      lowerCamelCase__     (	self  :					str					,				UpperCamelCase_  :					str				):
           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.'''				)
           lowerCAmelCase					:	Tuple       =   copy.deepcopy(self				)
           lowerCAmelCase					:	Any       =   self.input_schema.copy()
           lowerCAmelCase					:	str       =   features[self.audio_column]
           lowerCAmelCase					:	str       =   input_schema
           return task_template






     @property
     def      lowerCamelCase__     (	self  :					int				):
           return {self.audio_column: "audio", self.transcription_column: "transcription"}






"""simple docstring"""





def      _snake_case						(						_snake_case				:			float ,   _snake_case				:			list[float]			):
      if discount_rate < 0:
            raise ValueError('''Discount rate cannot be negative'''			)
      if not cash_flows:
            raise ValueError('''Cash flows list cannot be empty'''			)
      lowerCAmelCase					:	List[str]       =   sum(
          cash_flow / ((1 + discount_rate) ** i) for i, cash_flow in enumerate(_snake_case			)			)
      return round(_snake_case ,   ndigits=2			)


if __name__ == "__main__":
 import doctest

 doctest.testmod()


