

'''simple docstring'''


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

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




@dataclass(frozen=SCREAMING_SNAKE_CASE       )
class     a			(				SCREAMING_SNAKE_CASE       ):






      """simple docstring"""




      __UpperCAmelCase			     =    field(default="""summarization"""			,			metadata={"""include_in_asdict_even_if_is_default""": True}       )
      __UpperCAmelCase			     =    Features({"""text""": Value("""string"""       )}       )
      __UpperCAmelCase			     =    Features({"""summary""": Value("""string"""       )}       )
      __UpperCAmelCase			     =    """text"""
      __UpperCAmelCase			     =    """summary"""







      @property
      def       __magic_name__							(							self					:      str  ):



        '''simple docstring'''



        return {self.text_column: "text", self.summary_column: "summary"}






'''simple docstring'''


def 	_a       (				__lowerCAmelCase		:      float   ,							__lowerCAmelCase		:      float   ,							__lowerCAmelCase		:      int     ):

		"""simple docstring"""

		if principal <= 0:
				raise Exception('''Principal borrowed must be > 0'''     )
		if rate_per_annum < 0:
				raise Exception('''Rate of interest must be >= 0'''     )
		if years_to_repay <= 0 or not isinstance(__lowerCAmelCase   ,							__lowerCAmelCase     ):
				raise Exception('''Years to repay must be an integer > 0'''     )

		# Yearly rate is divided by 12 to get monthly rate
		snake_case__						:       int       						=  rate_per_annum / 12

		# Years to repay is multiplied by 12 to get number of payments as payment is monthly
		snake_case__						:       Tuple       						=  years_to_repay * 12

		return (
		    principal
		    * rate_per_month
		    * (1 + rate_per_month) ** number_of_payments
		    / ((1 + rate_per_month) ** number_of_payments - 1)
		)


if __name__ == "__main__":
					import doctest

					doctest.testmod()



