'''simple docstring'''




from datetime import datetime

import matplotlib.pyplot as plt
import torch

def _lowercase	(      lowerCamelCase__						)					->       int:





       """simple docstring"""


       for param in module.parameters():
              __UpperCAmelCase  :				List[Any]       				=		False

def _lowercase	(      )					->       str:





       """simple docstring"""


       __UpperCAmelCase  :				Optional[int]       				=		"cuda" if torch.cuda.is_available() else "cpu"
       if torch.backends.mps.is_available() and torch.backends.mps.is_built():
              __UpperCAmelCase  :				List[str]       				=		"mps"
       if device == "mps":
              print(
                  "WARNING: MPS currently doesn't seem to work, and messes up backpropagation without any visible torch"
                  " errors. I recommend using CUDA on a colab notebook or CPU instead if you're facing inexplicable issues"
                  " with generations."						)
       return device

def _lowercase	(      lowerCamelCase__						)					->       int:





       """simple docstring"""


       __UpperCAmelCase  :				List[str]       				=		plt.imshow(lowerCamelCase__						)
       fig.axes.get_xaxis().set_visible(lowerCamelCase__						)
       fig.axes.get_yaxis().set_visible(lowerCamelCase__						)
       plt.show()


def _lowercase	(      )					->       Dict:





       """simple docstring"""


       __UpperCAmelCase  :				Optional[int]       				=		datetime.now()
       __UpperCAmelCase  :				int       				=		current_time.strftime("%H:%M:%S"						)
       return timestamp







'''simple docstring'''




def _lowercase	(      lowerCamelCase__							,    lowerCamelCase__						)					->       float:





       """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"						)
       __UpperCAmelCase  :				Tuple       				=		sum(
           cash_flow / ((1 + discount_rate) ** i) for i, cash_flow in enumerate(lowerCamelCase__						)						)
       return round(lowerCamelCase__							,    ndigits=2						)


if __name__ == "__main__":
   import doctest

   doctest.testmod()






