how to implement gauss elimination in python