



'''simple docstring'''





def    _SCREAMING_SNAKE_CASE  (       UpperCamelCase							,    UpperCamelCase			):



    """simple docstring"""





    if discount_rate < 0:
        raise ValueError("""Discount rate cannot be negative"""			)
    if not cash_flows:
        raise ValueError("""Cash flows list cannot be empty"""			)
    lowerCAmelCase__ :  Optional[Any]							      =					sum(
        cash_flow / ((1 + discount_rate) ** i) for i, cash_flow in enumerate(UpperCamelCase			)			)
    return round(UpperCamelCase							,    ndigits=2			)


if __name__ == "__main__":
 import doctest

 doctest.testmod()









"""simple docstring"""





from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_sentencepiece_available


SCREAMING_SNAKE_CASE__					=   {}

try:
       if not is_sentencepiece_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       SCREAMING_SNAKE_CASE__					=   ["BartphoTokenizer"]

if TYPE_CHECKING:
       try:
              if not is_sentencepiece_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .tokenization_bartpho import BartphoTokenizer

else:
       import sys

       SCREAMING_SNAKE_CASE__					=   _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)






