move SO code to python for easier reuse

No match.