

from __future__ import annotations





def       __lowerCamelCase			(				UpperCamelCase__     ,							UpperCamelCase__     ,							UpperCamelCase__   ):







							'''simple docstring'''






							if days_between_payments <= 0:
														raise ValueError('days_between_payments must be > 0'   )
							if daily_interest_rate < 0:
														raise ValueError('daily_interest_rate must be >= 0'   )
							if principal <= 0:
														raise ValueError('principal must be > 0'   )
							return principal * daily_interest_rate * days_between_payments





def       __lowerCamelCase			(				UpperCamelCase__     ,							UpperCamelCase__     ,							UpperCamelCase__     ,							):







							'''simple docstring'''






							if number_of_compounding_periods <= 0:
														raise ValueError('number_of_compounding_periods must be > 0'   )
							if nominal_annual_interest_rate_percentage < 0:
														raise ValueError('nominal_annual_interest_rate_percentage must be >= 0'   )
							if principal <= 0:
														raise ValueError('principal must be > 0'   )

							return principal * (
							    (1 + nominal_annual_interest_rate_percentage) ** number_of_compounding_periods
							    - 1
							)





def       __lowerCamelCase			(				UpperCamelCase__     ,							UpperCamelCase__     ,							UpperCamelCase__     ,							):







							'''simple docstring'''






							if number_of_years <= 0:
														raise ValueError('number_of_years must be > 0'   )
							if nominal_annual_percentage_rate < 0:
														raise ValueError('nominal_annual_percentage_rate must be >= 0'   )
							if principal <= 0:
														raise ValueError('principal must be > 0'   )

							return compound_interest(
							    UpperCamelCase__     ,							nominal_annual_percentage_rate / 365     ,							number_of_years * 365   )


if __name__ == "__main__":
					import doctest

					doctest.testmod()







from unittest import TestCase

from datasets import Sequence, Value
from datasets.arrow_dataset import Dataset







class 				lowercase       ( lowercase_    ):




				def 					a							(      self ):
											return [
											    {"col_1": 3, "col_2": "a"},
											    {"col_1": 2, "col_2": "b"},
											    {"col_1": 1, "col_2": "c"},
											    {"col_1": 0, "col_2": "d"},
											]




				def 					a							(      self ):
											snake_case_           =					{'col_1': [3, 2, 1, 0], 'col_2': ['a', 'b', 'c', 'd']}
											return Dataset.from_dict(snake_case )




				def 					a							(      self ):
											snake_case_           =					self._create_example_records()
											snake_case_           =					Dataset.from_list(snake_case )
											self.assertListEqual(dset.column_names   ,     ['col_1', 'col_2'] )
											for i, r in enumerate(snake_case ):
																		self.assertDictEqual(snake_case   ,     example_records[i] )




				def 					a							(      self ):
											snake_case_           =					self._create_example_records()
											snake_case_           =					Dataset.from_list(snake_case )
											snake_case_           =					Dataset.from_dict({k: [r[k] for r in example_records] for k in example_records[0]} )
											self.assertEqual(dset.info   ,     dset_from_dict.info )




				def 					a							(      self ):  # checks what happens with missing columns
											snake_case_           =					[{'col_1': 1}, {'col_2': 'x'}]
											snake_case_           =					Dataset.from_list(snake_case )
											self.assertDictEqual(dset[0]   ,     {'col_1': 1} )
											self.assertDictEqual(dset[1]   ,     {'col_1': None} )  # NB: first record is used for columns




				def 					a							(      self ):  # checks if the type can be inferred from the second record
											snake_case_           =					[{'col_1': []}, {'col_1': [1, 2]}]
											snake_case_           =					Dataset.from_list(snake_case )
											self.assertEqual(dset.info.features['col_1']   ,     Sequence(Value('int64' ) ) )




				def 					a							(      self ):
											snake_case_           =					Dataset.from_list([] )
											self.assertEqual(len(snake_case )   ,     0 )
											self.assertListEqual(dset.column_names   ,     [] )




