

def 	snake_case__			(    SCREAMING_SNAKE_CASE_		:    list[list[int | float]]			):



     '''simple docstring'''





     lowercase__    :   List[Any]      =       len(SCREAMING_SNAKE_CASE_			)
     lowercase__    :   str      =       len(matrix[0]			)
     lowercase__    :   Tuple      =       min(SCREAMING_SNAKE_CASE_	,     SCREAMING_SNAKE_CASE_			)

     for row in range(SCREAMING_SNAKE_CASE_			):
          # Check if diagonal element is not zero
          if matrix[row][row] != 0:
               # Eliminate all the elements below the diagonal
               for col in range(row + 1	,     SCREAMING_SNAKE_CASE_			):
                    lowercase__    :   Optional[int]      =       matrix[col][row] / matrix[row][row]
                    for i in range(SCREAMING_SNAKE_CASE_	,     SCREAMING_SNAKE_CASE_			):
                         matrix[col][i] -= multiplier * matrix[row][i]
          else:
               # Find a non-zero diagonal element to swap rows
               lowercase__    :   Optional[int]      =       True
               for i in range(row + 1	,     SCREAMING_SNAKE_CASE_			):
                    if matrix[i][row] != 0:
                         lowercase__      , lowercase__    :   str      =       matrix[i], matrix[row]
                         lowercase__    :   Dict      =       False
                         break
               if reduce:
                    rank -= 1
                    for i in range(SCREAMING_SNAKE_CASE_			):
                         lowercase__    :   List[Any]      =       matrix[i][rank]

            # Reduce the row pointer by one to stay on the same row
               row -= 1

     return rank


if __name__ == "__main__":
       import doctest

       doctest.testmod()




def 	snake_case__			(    SCREAMING_SNAKE_CASE_		:    str			):



     '''simple docstring'''





     if not all(char in '01' for char in bin_string			):
          raise ValueError('Non-binary value was passed to the function'			)
     if not bin_string:
          raise ValueError('Empty string was passed to the function'			)
     lowercase__    :   Union[str, Any]      =       ''
     while len(SCREAMING_SNAKE_CASE_			) % 3 != 0:
          lowercase__    :   List[str]      =       '0' + bin_string
     lowercase__    :   Any      =       [
         bin_string[index : index + 3]
         for index in range(len(SCREAMING_SNAKE_CASE_			)			)
         if index % 3 == 0
     ]
     for bin_group in bin_string_in_3_list:
          lowercase__    :   str      =       0
          for index, val in enumerate(SCREAMING_SNAKE_CASE_			):
               oct_val += int(2 ** (2 - index) * int(SCREAMING_SNAKE_CASE_			)			)
          oct_string += str(SCREAMING_SNAKE_CASE_			)
     return oct_string


if __name__ == "__main__":
       from doctest import testmod

       testmod()

