Python implementation of vector fitting