
from __future__ import annotations






def   lowerCamelCase__							(							__lowerCAmelCase    :    float       ,				__lowerCAmelCase    :    float       ,				__lowerCAmelCase    :    float							):




			"""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__							(							__lowerCAmelCase    :    float       ,				__lowerCAmelCase    :    float       ,				__lowerCAmelCase    :    float       ,				):




			"""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__							(							__lowerCAmelCase    :    float       ,				__lowerCAmelCase    :    float       ,				__lowerCAmelCase    :    float       ,				):




			"""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(
			    __lowerCAmelCase       ,				nominal_annual_percentage_rate / 365       ,				number_of_years * 365							)


if __name__ == "__main__":
			import doctest

			doctest.testmod()





from math import ceil






def   lowerCamelCase__							(							__lowerCAmelCase    :    Dict       ,				__lowerCAmelCase    :    int							):




			"""simple docstring"""


			lowerCAmelCase_         =      list(range(0       ,				__lowerCAmelCase							)							)

			lowerCAmelCase_         =      [item for sublist in list(device_map.values()							) for item in sublist]

			# Duplicate check
			lowerCAmelCase_         =      []
			for i in device_map_blocks:
						if device_map_blocks.count(__lowerCAmelCase							) > 1 and i not in duplicate_blocks:
									duplicate_blocks.append(__lowerCAmelCase							)
    # Missing blocks
			lowerCAmelCase_         =      [i for i in blocks if i not in device_map_blocks]
			lowerCAmelCase_         =      [i for i in device_map_blocks if i not in blocks]

			if len(__lowerCAmelCase							) != 0:
						raise ValueError(
						    "Duplicate attention blocks specified in device_map. Attention blocks must be specified to one device."
						    " These attention blocks were specified more than once: " + str(__lowerCAmelCase							)							)
			if len(__lowerCAmelCase							) != 0:
						raise ValueError(
						    "There are attention blocks for this model that are not specified in the device_map. Add these attention "
						    "blocks to a device on the device_map: " + str(__lowerCAmelCase							)							)
			if len(__lowerCAmelCase							) != 0:
						raise ValueError(
						    "The device_map contains more attention blocks than this model has. Remove these from the device_map:"
						    + str(__lowerCAmelCase							)							)






def   lowerCamelCase__							(							__lowerCAmelCase    :    List[str]       ,				__lowerCAmelCase    :    Tuple							):




			"""simple docstring"""


			lowerCAmelCase_         =      list(range(__lowerCAmelCase							)							)
			lowerCAmelCase_         =      int(ceil(n_layers / len(__lowerCAmelCase							)							)							)
			lowerCAmelCase_         =      [layers[i : i + n_blocks] for i in range(0       ,				__lowerCAmelCase       ,				__lowerCAmelCase							)]

			return dict(zip(__lowerCAmelCase       ,				__lowerCAmelCase							)							)



