Complex Function In Python Example