Translated php to python stored procedure