def swap_rows(mat_in, row,  col):
    """
    This function swaps a matrix row with another row.
    Swaping will be done if the element at the position specified by the user
    via the 'row' and 'col' variables, is zero. Swaping occurs with a row that
    has a non-zero element in the same 'col'. If all rows contain a
    zero at the 'row', 'col' position, the original input matrix is returned.

    :param mat_in: list of lists, i.e. a matrix
    :param row: int, row index in a matrix
    :param col: int, column index in a matrix
    :return: tuple, a list of lists and a multiplier that is either 1 if no
    swapping has been done, or -1 if swapping was done.
    """

    if mat_in[row][col] != 0:
        # return the original matrix if the matrix element at the
        # input [row][col] position is not zero
        multiplier = 1
        return mat_in, multiplier
    else:
        # find a row with non-zero matrix element in the same [col] position
        # and swap. If swaping is done, the matrix determinant should be multiplied
        # by -1, therefore a multiplier = -1 is returned togeteher with the matrix with
        # swapped rows.
        for idx in range(row+1, len(mat_in)):
            if mat_in[idx][col] != 0:
                mat_in[row], mat_in[idx] = mat_in[idx], mat_in[row]
                multiplier = -1
                return mat_in, multiplier
        # if the if-else block is skipped, means all rows have a zero
        # matrix element along the [col], in this case we return the original matrix
        multiplier = 1
        return mat_in, multiplier