Python Language Create A Function In R