

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

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



@dataclass(frozen=_A     )
class   __lowercase    (			_A     ):




			"""simple docstring"""







			_UpperCAmelCase       :							str      							=					field(default='''audio-classification'''		,	metadata={'''include_in_asdict_even_if_is_default''': True}     )
			_UpperCAmelCase       :							Tuple      							=					Features({'''audio''': Audio()}     )
			_UpperCAmelCase       :							str      							=					Features({'''labels''': ClassLabel}     )
			_UpperCAmelCase       :							Tuple      							=					'''audio'''
			_UpperCAmelCase       :							Union[str, Any]      							=					'''labels'''



			def 	_SCREAMING_SNAKE_CASE      (			self  :					Union[str, Any]       ,						lowerCAmelCase__  :					Optional[Any]):
									if self.label_column not in features:
															raise ValueError(F"Column {self.label_column} is not present in features.")
									if not isinstance(features[self.label_column]       ,						__SCREAMING_SNAKE_CASE):
															raise ValueError(F"Column {self.label_column} is not a ClassLabel.")
									SCREAMING_SNAKE_CASE_:			Any  		=	copy.deepcopy(self)
									SCREAMING_SNAKE_CASE_:			Tuple  		=	self.label_schema.copy()
									SCREAMING_SNAKE_CASE_:			Tuple  		=	features[self.label_column]
									SCREAMING_SNAKE_CASE_:			List[str]  		=	label_schema
									return task_template




			@property
			def 	_SCREAMING_SNAKE_CASE      (			self  :					Union[str, Any]):
									return {
									    self.audio_column: "audio",
									    self.label_column: "labels",
									}








import os

# Precomputes a list of the 100 first triangular numbers
lowerCAmelCase							:  Optional[int]            =						[int(0.5 * n * (n + 1)) for n in range(1, 101)]







def       A_				(   ):
						SCREAMING_SNAKE_CASE_:			List[str]  		=	os.path.dirname(os.path.realpath(_UpperCAmelCase   )   )
						SCREAMING_SNAKE_CASE_:			Union[str, Any]  		=	os.path.join(_UpperCAmelCase    ,     "words.txt"   )

						SCREAMING_SNAKE_CASE_:			Dict  		=	""
						with open(_UpperCAmelCase   ) as f:
												SCREAMING_SNAKE_CASE_:			int  		=	f.readline()

						SCREAMING_SNAKE_CASE_:			Optional[int]  		=	[word.strip("\""   ) for word in words.strip("\r\n"   ).split(","   )]
						SCREAMING_SNAKE_CASE_:			List[Any]  		=	[
						    word
						    for word in [sum(ord(_UpperCAmelCase   ) - 64 for x in word   ) for word in words]
						    if word in TRIANGULAR_NUMBERS
						]
						return len(_UpperCAmelCase   )


if __name__ == "__main__":
						print(solution())






