'''simple docstring'''
def  __lowerCamelCase       (      _UpperCamelCase  :  list[int]							,    _UpperCamelCase  :  list[int]					):


      '''simple docstring'''


      if not len(_UpperCamelCase					) == len(_UpperCamelCase					) == 3:
            raise ValueError('''Please enter a valid equation.'''					)
      if equationa[0] == equationa[1] == equationa[0] == equationa[1] == 0:
            raise ValueError('''Both a & b of two equations can\'t be zero.'''					)

      # Extract the coefficients
      UpperCAmelCase_      ,		UpperCAmelCase_      ,		UpperCAmelCase_            =  equationa
      UpperCAmelCase_      ,		UpperCAmelCase_      ,		UpperCAmelCase_            =  equationa

      # Calculate the determinants of the matrices
      UpperCAmelCase_            =  aa * ba - aa * ba
      UpperCAmelCase_            =  ca * ba - ca * ba
      UpperCAmelCase_            =  aa * ca - aa * ca

      # Check if the system of linear equations has a solution (using Cramer's rule)
      if determinant == 0:
            if determinant_x == determinant_y == 0:
                  raise ValueError('''Infinite solutions. (Consistent system)'''					)
            else:
                  raise ValueError('''No solution. (Inconsistent system)'''					)
      else:
            if determinant_x == determinant_y == 0:
                  # Trivial solution (Inconsistent system)
                  return (0.0, 0.0)
            else:
                  UpperCAmelCase_            =  determinant_x / determinant
                  UpperCAmelCase_            =  determinant_y / determinant
                  # Non-Trivial Solution (Consistent system)
                  return (x, y)






'''simple docstring'''
from datetime import datetime

import matplotlib.pyplot as plt
import torch



def  __lowerCamelCase       (      _UpperCamelCase  :  Union[str, Any]					):


      '''simple docstring'''


      for param in module.parameters():
            UpperCAmelCase_            =  False



def  __lowerCamelCase       (      ):


      '''simple docstring'''


      UpperCAmelCase_            =  '''cuda''' if torch.cuda.is_available() else '''cpu'''
      if torch.backends.mps.is_available() and torch.backends.mps.is_built():
            UpperCAmelCase_            =  '''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  __lowerCamelCase       (      _UpperCamelCase  :  Union[str, Any]					):


      '''simple docstring'''


      UpperCAmelCase_            =  plt.imshow(_UpperCamelCase					)
      fig.axes.get_xaxis().set_visible(_UpperCamelCase					)
      fig.axes.get_yaxis().set_visible(_UpperCamelCase					)
      plt.show()





def  __lowerCamelCase       (      ):


      '''simple docstring'''


      UpperCAmelCase_            =  datetime.now()
      UpperCAmelCase_            =  current_time.strftime('''%H:%M:%S'''					)
      return timestamp





