a set of python implementations for reference