Translates Perl code to its Python equivalent. Written in Perl