Translated test functions from c++ into python