Python implementation of Sum-Product for Factor Graphs